Re-Prog3113 Progg (Oracle Database) Nciiip1
Re-Prog3113 Progg (Oracle Database) Nciiip1
State Finished
Completed on Monday, 1 February 2021, 12:28 AM
Time taken 51 mins 29 secs
Grade 63.00 out of 80.00 (79%)
Question 1
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Nathaniel had accidentally deleted all the records in the newly updated ORACLE database using
the DELETE SQL command.
What is the best solution that he can do to restore all the deleted records in the database.
Select one:
a. None of the choices
b. Restore the backup copy
c. Execute the UNDELETE command
d. Run the ROLLBACK command
e. Re-encode the data
Feedback
Question 3
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following SQL command will display all records with part number contains the
number 9?
Select one:
a. SELECT * FROM parts WHERE partnum IN ('%9%')
b. SELECT * from parts WHERE partnum LIKE '%9%'
c. SELECT partnum FROM parts WHERE partnum = ‘%9%’
d. SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%9%’
Feedback
The correct answer is: SELECT * from parts WHERE partnum LIKE '%9%'
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
John want to know how many part items are there in warehouse number 3.
Select one:
a. SELECT COUNT(*) FROM parts WHERE warehouse = 3;
b. SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;
c. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
d. SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;
Feedback
The correct answer is: SELECT COUNT(*) FROM parts WHERE warehouse = 3;
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Select one:
a. The following will grant query privileges on the DEPARTMENTS table:
b. The folllowing will grant object privileges on USER user1
c. None of the choices
d. The SQL command is incorrect
Feedback
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Data
b. Index
c. Subtype
d. Data dictionary
e. Schema
Feedback
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 10
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
1. DECLARE
2. SUBTYPE Accumulator IS NUMBER (4,2);
3. v_amount accumulator;
4. v_num1 NUMBER;
5. v_num2 NUMBER;
6. v_num3 NUMBER;
7. BEGIN
8. v_amount := 10.50;
9. v_num1 := 1;
10. v_num2 := 2;
11. v_num3 := 3;
12. v_num1 := v_amount;
13. v_num2 := v_num1 + v_amount;
14. v_num2 := v_num2 - v_num3;
15.
16. dbms_output.put_line('Total is: ' || v_num2);
17.
18. END;
Select one:
a. 18
b. 8.5
c. -1
d. None of the choices
Feedback
Question 12
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Restrictive, specifies a RETURN type, associates only with type-compatible queries are
description of a ________________.
Select one:
a. Functional REF CURSOR
b. Relational REF CURSOR
c. Procedural REF CURSOR
d. Strong REF CURSOR
e. Weak REF CURSOR
Feedback
Question 13
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Family, friends, co-workers and those identified with the direct victims
Select one:
a. direct victims
b. indirect victims
c. Critical Incident Stress Debriefing (CISD)
d. critical incidents
e. hidden victims
Feedback
Question 14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
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:
a. SELECT employees FROM employee_id, first_name, last_name WHERE first_name
LIKE ‘D%’ and job_id = ‘IT_PROG’ ORDER BY department_id
b. SELECT employee_id, first_name, last_name FROM employees ORDER BY
department_id WHERE first_name LIKE 'D%' and job_id = 'IT_PROG'
c. 'IT_PROG' OR first_name LIKE 'D%' and ORDER BY department_id
d. SELECT employee_id, first_name, last_name FROM employees 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 job_id =
'IT_PROG' OR first_name LIKE 'D%' and ORDER BY department_id
Feedback
The correct answer is: SELECT employee_id, first_name, last_name FROM employees WHERE
first_name LIKE 'D%' and job_id = 'IT_PROG' ORDER BY department_id
Question 15
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: SELECT * FROM EMPLOYEES WHERE job_id LIKE '%ACCOUNT
%';
Question 16
Not answered
Marked out of 1.00
Flag question
Question text
A Answer is a weather condition that produces lightning and thunder, heavy rainfall from
cumulonimbus clouds and possibly a tornado.
Feedback
Question 17
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 18
Not answered
Marked out of 1.00
Flag question
Question text
Feedback
Question 19
Correct
Mark 1.00 out of 1.00
Flag question
Question text
There was 10% price increase in the all the parts in warehouse number 3. The Store Manager
asked the Database Administrator to generate a report showing the part number, the old and new
price.
Which of the following SQL statement would satisfy the requirement of the Store Manager.
Select one:
a. SELECT partnum, price, price * 0.1 FROM parts WHERE warehouse = 3
b. SELECT partnum, price, price * 10% FROM parts WHERE warehouse = 3
c. SELECT partnum, price, price * 1.1 FROM parts WHERE warehouse = 3
d. SELECT partnum, price, price * 1.10% FROM parts WHERE warehouse = 3
Feedback
The correct answer is: SELECT partnum, price, price * 1.1 FROM parts WHERE warehouse = 3
Question 20
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
TRUE OR FALSE.
Multiple fields in NOT allowed in a Foreign key.
Select one:
True
False
Feedback
Question 22
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Using Data Manipulation Language, you can ADD columns in the table.
Select one:
True
False
Feedback
Question 23
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following will erase all records in the departments table
Select one:
a. DELETE FROM departments
b. TRUNCATE FROM TABLE departments
c. TRUNCATE TABLE departments
d. DELETE * FROM departments
Feedback
Question 24
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
1. The two development environments of Oracle are _______________ and ______________.
Select one:
a. Oracle SQL Developer; SQL command line
b. Oracle SQL Developer; ANSI SQL Web
c. Oracle DB; SQL command line
d. ANSI SQL Web; Oracle Net SQL
Feedback
Question 25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: The SQL command will produce a correct output.
Question 26
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 27
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 28
Correct
Mark 1.00 out of 1.00
Flag question
Question text
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 FROM employees WHERE salary *12 >= 100000 AND
salary *12 <= 200000 ORDER BY salary desc
b. SELECT employee_id, salary FROM employees WHERE salary *12 >= 100000 AND
salary *12 <= 200000 ORDER BY salary
c. SELECT employee_id, salary FROM employees WHERE salary >= 100000 AND salary
<= 200000 ORDER BY salary
d. SELECT employee_id, salary, salary *12 FROM employees WHERE 12* salary =
100000 AND 12 *salary = 200000 ORDER BY salary
Feedback
The correct answer is: SELECT employee_id, salary FROM employees WHERE salary *12 >=
100000 AND salary *12 <= 200000 ORDER BY salary desc
Question 29
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
True or False: Generally, all thunderstorms are caused by the cooling of the upper layers of air
by radiation.
True
Answer:
Feedback
Question 30
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Locks the rows in the EMPLOYEES table with department id is 60.
b. Creates a temporary table with department = 60
c. Unlock all records with department id = 60
d. All users accessing the department id 60 can accept UPDATE command simultaneously.
Feedback
The correct answer is: Locks the rows in the EMPLOYEES table with department id is 60.
Question 31
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 32
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A _______________ consists of a collection of DML statements that form a logical unit of work.
Select one:
a. Transaction
b. Database
c. SQL command
d. All of the choices
Feedback
The correct answer is: Transaction
Question 33
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Display the warehouse number, class, highest price & lowest price, total on hand balance whose
class is AP.
Select one:
a. SELECT warehouse, class, MAX(price), MIN(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse, class
ORDER BY warehouse;
WHERE class = 'AP'
b. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class, price
ORDER BY warehouse, class
c. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class
ORDER BY warehouse;
d. SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse
WHERE class = 'AP'
ORDER BY warehouse, class;
Feedback
The correct answer is: SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class
ORDER BY warehouse;
Question 34
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: Ensure that electrical appliances are checked before switching them on.
Question 35
Not answered
Marked out of 1.00
Flag question
Question text
Feedback
Question 36
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 37
Correct
Mark 1.00 out of 1.00
Flag question
Question text
You can relate data to multiple tables using a foreign key.
Select one:
True
False
Feedback
Question 38
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Display the name, jobs id and salary of the all the employees whose department id is 100 and
salary is below 8000. Arrange the output by salary in ascending order.
Select one:
a. SELECT employees FROM first_name, last_name, salary WHERE department_id = 100
AND salary < 8000 ORDER BY salary ASC
b. SELECT name, salary FROM employees WHERE department_id = 100 AND salary <
8000 ORDER BY salary ASC
c. SELECT name FROM employees WHERE salary < 8000 AND department_id = 100
AND ORDER BY department_id
d. SELECT first_name, last_name, salary FROM employees WHERE salary < 8000 AND
department_id = 100 AND ORDER BY department_id
e. SELECT first_name, last_name, salary FROM employees ORDER BY salary WHERE
department_id = 100 AND salary > 8000
f. SELECT first_name, last_name, salary FROM employees WHERE department_id = 100
AND salary < 8000 ORDER BY salary
Feedback
The correct answer is: SELECT first_name, last_name, salary FROM employees WHERE
department_id = 100 AND salary < 8000 ORDER BY salary
Question 39
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Crisis workers, volunteers, disaster managers and staff, police, firemen, hospital workers
Select one:
a. Critical Incident Stress Debriefing (CISD)
b. hidden victims
c. indirect victims
d. direct victims
e. critical incidents
Feedback
Question 40
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 41
Correct
Mark 1.00 out of 1.00
Flag question
Question text
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Schema
b. Data dictionary
c. Data
d. Subtype
e. Index
Feedback
Question 42
Correct
Mark 1.00 out of 1.00
Flag question
Question text
ANSI SQL commands cannot be abbreviated.
Select one:
True
False
Feedback
Question 43
Correct
Mark 1.00 out of 1.00
Flag question
Question text
CISD is conducted through sharing- reflection sessions that are not confidential
Select one:
a. True
b. False
Feedback
Question 44
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 45
Correct
Mark 1.00 out of 1.00
Flag question
Question text
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 WHERE SUM(ONHAND) > 50
c. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse,class
HAVING SUM(ONHAND) > 50
d. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse HAVING
SUM(ONHAND) > 50
Feedback
The correct answer is: SELECT warehouse, class, sum(onhand) FROM parts GROUP BY
warehouse,class HAVING SUM(ONHAND) > 50
Question 46
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 47
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is INCORRECT about the guidelines for cursor design?
Select one:
a. Close a cursor when it is no longer needed.
b. Simplify coding with cursor FOR loops.
c. Use column aliases in cursors for calculated columns fetched into records declared with
%COLUMNTYPE.
d. None of the choices.
Feedback
The correct answer is: Use column aliases in cursors for calculated columns fetched into records
declared with %COLUMNTYPE.
Question 48
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 49
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Debriefing was originally developed to assist crisis response teams in recognizing and managing
their own normal reactions to traumatic exposure.
Select one:
a. False
b. True
Feedback
Question 50
Correct
Mark 1.00 out of 1.00
Flag question
Question text
SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP')
AND (price > 200 AND price < 500);
Select one:
a. Error
b. Invalid SQL command
c. 0 rows returned
d. 7 rows returned
e. 2 rows returned
Feedback
Question 51
Correct
Mark 1.00 out of 1.00
Flag question
Question text
List all the employee_id of all employees whose salary is 5000 and below and belong to
department 60 or 100.
Select one:
a. SELECT employee_id,salary, department_id FROM employees WHERE salary < 5000
AND department_id IN (60,100)
b. SELECT employee_id,salary, department_id FROM employees WHERE salary < 5000
AND department_id IN (60 OR 100)
c. SELECT employees FROM employee_id,salary, department_idWHERE salary < 5000
AND department_id IN (60,100)
d. SELECT employee_id FROM employee WHERE salary < 5000 AND department_id IN
('60,'100')
Feedback
The correct answer is: SELECT employee_id,salary, department_id FROM employees WHERE
salary < 5000 AND department_id IN (60,100)
Question 52
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Through debriefing individuals realize that experiencing severe stress during a critical incident is
a normal reaction.
Select one:
a. True
b. False
Feedback
Question 53
Not answered
Marked out of 1.00
Flag question
Question text
Feedback
Question 54
Correct
Mark 1.00 out of 1.00
Flag question
Question text
TRUE OR FALSE.
A FOREIGN KEY is a field in one table that refers to the PRIMARY KEY in another table.
Select one:
True
False
Feedback
Question 55
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following DOES NOT describes the state of the data after the COMMIT command
Select one:
a. The previous state of the data is overwritten.
b. All savepoints are erased.
c. All users can view the results.
d. Locks on the affected rows are released; those rows are available for other users to
manipulate.
e. None of the choices
f. Data changes are saved in the database.
Feedback
Question 56
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 57
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: OPEN cursor_variable_name
FOR select_statement;
Question 58
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 59
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 60
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Feedback
Question 61
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Use column aliases in cursors for calculated columns fetched into records declared with
%COLUMNTYPE.
Select one:
True
False
Feedback
Question 62
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 63
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Strong reactions if not discussed and understood can interfere with work and home life during
and after the event.
Select one:
a. True
b. False
Feedback
Question 64
Correct
Mark 1.00 out of 1.00
Flag question
Question text
TRUE OR FALSE.
The INSERT statement can add multiple rows.
Select one:
True
False
Feedback
Question 65
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Using CREATE SQL Command, you can add new records in the table.
Select one:
True
False
Feedback
Question 66
Correct
Mark 1.00 out of 1.00
Flag question
Question text
It is an event, caused by natural or man-made and managing hazards that has the potential for
causing powerful reaction in the majority who are exposed to it.
Select one:
a. hidden victims
b. direct victims
c. critical incidents
d. indirect victims
e. Critical Incident Stress Debriefing (CISD)
Feedback
The correct answer is: critical incidents
Question 67
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The General Manager request to the Database Administrator to generate the total number of parts
and total outstanding balance on hand of every class in warehouse number 1&2.
Which of the following SQL command will generate the required output.
Select one:
a. SELECT warehouse, class, count(partnum), sum(onhand) GROUP BY warehouse,class
HAVING warehouse = 1 or warehouse = 2 FROM parts;
b. SELECT warehouse, class, COUNT(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 OR warehouse = 2;
c. SELECT warehouse, class, count(partnum), sum(onhand) GROUP BY warehouse,class
WHERE warehouse = 1 or warehouse = 2 FROM parts;
d. SELECT warehouse, class, SUM(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 AND warehouse = 2;
Feedback
The correct answer is: SELECT warehouse, class, COUNT(partnum), SUM(onhand) FROM
parts GROUP BY warehouse,class HAVING warehouse = 1 OR warehouse = 2;
Question 68
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 69
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
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 a _____________.
Select one:
a. INNER JOIN
b. NATURAL JOIN
c. OUTER JOIN
d. FULL OUTER JOIN
Feedback
Question 70
Correct
Mark 1.00 out of 1.00
Flag question
Question text
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.
Select one:
a. Unmatched
b. Matched
c. Missing
d. Intersect
Feedback
Question 71
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: Object
Question 72
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 73
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following SQL command will display the summary table showing the total quantity
on hand per class.
Select one:
a. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY class
b. SELECT class, onhand AS "QTY ON HAND" FROM parts GROUP BY sum(onhand)
c. SELECT class, TOTAL(onhand) AS "QTY ON HAND" FROM parts GROUP BY class,
onhand
d. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY onhand
Feedback
The correct answer is: SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts
GROUP BY class
Question 74
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 75
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following command will delete all records in the table employees
Select one:
a. DELETE ALL FROM employees
b. DELETE employees WHERE ORASYS_REC > 0
c. DELETE ALL RECORDS employees
d. DELETE FROM employees
Feedback
Question 76
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Aldrin wants to know the outstanding total balance on hand on every class per warehouse.
Select one:
a. SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM parts GROUP
BY warehouse, class
b. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
c. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse), sum(class);
d. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, class
Feedback
The correct answer is: SELECT warehouse, class, sum(onhand) FROM parts GROUP BY
warehouse, class
Question 77
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 78
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: DML
Question 79
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
Question 80
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Feedback
The correct answer is: B