BL Prog 3114. 2019 2020.
BL Prog 3114. 2019 2020.
3114-LAB-
1922S
SY:2019-2020
YELLOW – CORRECT
GREEN – CORRECT
RED – INCORRECT
By: Rose Del Concepcion
Which of the following is the correct report that will display the CLASS from table PARTS.
Select one:
c. SELECT CLASS FROM PARTS;
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 FROM parts WHERE price <
500 ORDER BY warehouse, class;
Which of the following SQL command will display all records with class code of AP?
Select one:
a. SELECT * FROM parts WHERE class = ‘AP’;
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 employee_id, first_name, last_name FROM employees WHERE first_name
LIKE 'D%' and job_id = 'IT_PROG' ORDER BY department_id
Which of the following SELECT statement is the correctreport that will combine the column
PARTNUM and DESCRIPTION put a literal character string "belongs to" in between the two
columns then rename the column as "NUMBER TITLE". Note put space before and after the
character literal string to avoid no spaces in the report.
b. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS "NUMBER
TITLE" FROM PARTS;
Which of the following SELECT statement is the correct report that will deduct 5 from
ONHAND, multiply 5 in WAREHOUSE, after getting the value on both ONHAND and
WAREHOUSE add their data: as shown below: ONHAND - 5 + 5 * WAREHOUSE
Note that you have to force the Oracle to prioritize first the Subtraction over Multiplication. List
only the column DESCRIPTION, ONHAND and WAREHOUSE.
b. SELECT (ONHAND-5) + 5 * WAREHOUSE, DESCRIPTION FROM PARTS;
Using Data Manipulation Language, you can ADD columns in the table.
Select one:
False
Which of the following SELECT statement is the correctreport the will merge the column
CLASS and PRICE rename the COLUMN as "CLASS PRICE".
c. SELECT (CLASS||PRICE) AS "CLASS PRICE" FROM PARTS;
Display the employee id, number of years and the hiring date of every employee in the
company.
b. SELECT employee_id, hire_date, ROUND((SYSDATE - hire_date) /365,0) FROM
employees;
Display the first 5 letter in the surname of all the employees whose firstname starts with letter
'D'
c. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE
SUBSTR(first_name,1,1) = 'D'
Using CREATE SQL Command, you can add new records in the table.
False
Display the first 3 letter in the first name of all the employees.
c. SELECT SUBSTR(first_name,1,3) FROM employees;
Which of the following SELECT statement is the correct PL/SQL that will display all rows and
columns?
d. SELECT * FROM PARTS;
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.
b. SELECT first_name, last_name, salary FROM employees WHERE department_id = 100
AND salary < 8000 ORDER BY salary
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
b. SELECT employee_id, salary, salary * 1.5 AS Bonus FROM employees
Which of the following SQL commands will display all stocks whose class is HW or AP.
d. SELECT * FROM parts WHERE IN class ('HW', 'AP');
Display the last day of the month and the hiring date when the employees are hired in the
company.
b. SELECT LAST_DAY(hire_date), hire_date FROM employees;
Display all the records whose stock is below 20 and in warehouse number 3.
d. SELECT * FROM parts WHERE onhand< 20 AND warehouse = 3;
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.
b. SELECT employee_id, job_id, salary, MOD(salary, 3000) FROM employees WHERE
job_id = 'IT_PROG'
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
c. SELECT CONCAT(CONCAT(last_name, ','), first_name) AS Fullname FROM
employees;
Question 1
Display the montly salary of every employee. Round the salary in 2 decimal places.
e. SELECT ROUND( (salary/12),2 ) FROM employees;
Question 2
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
c. SELECT CONCAT(CONCAT(employee_id, ':'), last_name) AS Employee FROM
employees WHERE salary >= 5000 AND salary <= 10000
Which of the following SQL commands will display all the stocks on hand from 10 to 30?
e. SELECT * FROM parts WHERE onhand BETWEEN 10 AND 30;
Display the total number of characters of the last name of all the employees.
a. SELECT LENGTH(last_name) FROM employees;
Display all the records sorted by price from most expensive to the cheapest parts.
g. SELECT * FROM parts ORDER BY price DESC
Display part number description and warehouse number whose part number starts with letter K.
c. SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE 'K%';
Which of the following SELECT statement is the correct PL/SQL that will display eliminate the
duplicate rows for column class and warehouse.
d. SELECT DISTINCT CLASS, WAREHOUSE FROM PARTS;
Which of the following SELECT statement is the correct PL/SQL that willcreate a report that
will add 10% increase in PRICE? List only the column DESCRIPTION, CLASS and PRICE.
Select one:
a. SELECT PRICE*0.10, DESCRIPTION, CLASS FROM PARTS;
b. SELECT PRICE*10, DESCRIPTION, CLASS FROM PARTS;
c. SELECT PRICE*10+PRICE, DESCRIPTION, CLASS FROM PARTS;
d. SELECT PRICE*0.10 FROM PARTS;
Ronnie is the stockman in the warehouse of ATR Corporation. The General Manager wants to
know the parts whose price is above 10000 and above. Which of the following SQL command
that Ronnie will run to generate the list.
f. SELECT * FROM parts WHERE price >= 10000;
Which of the following SELECT statement is the correct report that will display the unique
value for WAREHOUSE renames the column as "No. of Available Warehouse".
Select one:
d. SELECT DISTINCT WAREHOUSE AS "No. of available warehouse" FROM PARTS;
Which of the following SELECT statement is the correct report that will deduct 5 from
ONHAND, multiply 5 in WAREHOUSE, after getting the value on both ONHAND and
WAREHOUSE add their data: as shown below: ONHAND - 5 + 5 * WAREHOUSE
Note that you have to force the Oracle to prioritize first the Subtraction over Multiplication. List
only the column DESCRIPTION, ONHAND and WAREHOUSE.
a. SELECT (ONHAND-5) + 5 * WAREHOUSE, DESCRIPTION FROM PARTS;
Display all the records sorted by price from most expensive to the cheapest parts.
a. SELECT * FROM parts ORDER BY price DESC
List all the employee_id of all employees whose salary is 5000 and below and belong to
department 60 or 100.
c. SELECT employee_id,salary, department_id FROM employees WHERE salary < 5000
AND department_id IN (60,100)
Which of the following SELECT statement is the correct PL/SQL that willcreate a report
specifying only the column PRICE, ONHAND and DESCRIPTION?
c. SELECT PRICE, ONHAND, DESCRIPTION FROM PARTS;
Display part number description and warehouse number whose part number starts with letter K.
c. SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE 'K%';
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
c. SELECT CONCAT(CONCAT(employee_id, ':'), last_name) AS Employee FROM
employees WHERE salary >= 5000 AND salary <= 10000
Which of the following SQL command will display all records with class code of AP?
Select one:
a. SELECT * FROM parts WHERE class = ‘AP’;
Which of the following SELECT statement is the correct PL/SQL that willcreate a report
specifying only the column PRICE, ONHAND and DESCRIPTION?
c. SELECT PRICE, ONHAND, DESCRIPTION FROM PARTS;
Which of the following SELECT statement is the correct report that will rename the column
DESCRIPTION to TITLE, PARTNUM to ID and ONHAND to STOCK?
c. SELECT DESCRIPTION AS 'TITLE', PARTNUM AS 'ID', ONHAND AS 'STOCK'
FROM PARTS;
Which of the following SELECT statement is the correct PL/SQL that will display eliminate the
duplicate rows for column class and warehouse.
Select one:
a. SELECT DISTINCT CLASS, WAREHOUSE FROM PARTS;
b. SELECT DISTINCT CLASS AND DISTINCT WAREHOUSE FROM PARTS;
c. SELECT DISTINCT CLASS, DISTINCT WAREHOUSE FROM PARTS;
d. SELECT DISTINCT CLASS AND WAREHOUSE FROM PARTS;
Question 7
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 FROM parts ORDER BY
warehouse, class WHERE price < 500;
b. SELECT partnum, description, warehouse, onhand, price FROM parts WHERE price <
500 ORDER BY warehouse, class;
c. SELECT partnum, description, warehouse, onhand, price WHERE price < 500 ORDER
BY warehouse, class FROM parts
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 8
Question 9
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:
a. SELECT CONCAT(last_name, first_name) FROM employees
b. SELECT CONCAT(last_name, ',', first_name) AS Fullname FROM employees
c. SELECT CONCAT(last_name, first_name) AS Fullname FROM employees;
d. SELECT CONCAT(CONCAT(last_name, ','), first_name) AS Fullname FROM
employees;
Question 10
Which of the following SELECT statement is the correctreport that will combine the column
PARTNUM and DESCRIPTION put a literal character string "belongs to" in between the two
columns then rename the column as "NUMBER TITLE". Note put space before and after the
character literal string to avoid no spaces in the report.
Select one:
a. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS "NUMBER
TITLE" FROM PARTS;
b. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS NUMBER TITLE
FROM PARTS;
c. SELECT (PARTNUM|| THAT BELONGS TO ||DESCRIPTION) AS "NUMBER
TITLE" FROM PARTS;
d. SELECT (;PARTNUM'||' THAT BELONGS TO '||'DESCRIPTION;) AS "NUMBER
TITLE" FROM PARTS;
Question 1
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 INTO jobs VALUES ('JAVA_DEV', 'Java Developer', 7000, 8000)
b. INSERT FROM jobs SET jobs_id = ‘JAVA_DEV’, job_title = ‘Java Developer’ ,
min_salary =7000 , max_salary= 8000
c. INSERT FROM jobs(jobs_id, job_title, min_salary, max_salary) VALUES
('JAVA_DEV', 'Java Developer', 7000, 8000)
d. INSERT * INTO jobs VALUES (JAVA_DEV, Java Developer, 7000, 8000)
Question 2
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.
Select one:
a. INSERT * FROM departments VALUES (300, 'Training', 203, 2400)
b. INSERT INTO departments SET department_id = 300, department_name = 'Training',
manager_id = 203, location_id = 2400
c. INSERT FROM departments(department_id, department_name, manager_id, location_id)
VALUES (300, 'Training', 203, 2400)
d. INSERT INTO departments VALUES (300, 'Training', 203, 2400)
Question 3
Display the location id of all employee's name and salary whose salary is from 5000 to 10000.
Select one:
a. SELECT first_name, last_name, salary FROM employees JOIN departments USING
(department_id) WHERE salary >= 5000 AND salary <= 10000
b. SELECT first_name, last_name, salary FROM employees JOIN departments USING
(department_id) WHERE MIN(salary) = 5000 AND MAX(salary) = 10000
c. SELECT employees.first_name, employees.last_name, employees.salary FROM
employees CROSS JOIN departments USING (department_id) WHERE employees.salary >=
5000 AND employees.salary <= 10000
d. SELECT employees.first_name, employees.last_name, employees.salary FROM
employees JOIN departments ON (department_id) WHERE employees.salary >= 5000 AND
employees.salary <= 10000
Question 4
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 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 FROM employees SET manager_id = 200, SET department_id = 10 WHERE
last_name = 'Lorentz' AND first_name = 'Diana';
Question 5
Question 6
Update the Purchasing department name to Procurement. And this will be managed by the
Manager of Administration department.
Select one:
a. UPDATE departments SET department_name = 'Procurement', manager_id = 200
WHERE department_name = 'Purchasing'
b. UPDATE departments_name FROM departments SET department_name =
'Procurement', SET manager_id = 200 WHERE department_name = 'Purchasing'
c. UPDATE FROM departments SET department_name = 'Procurement' AND manager_id
= 200 WHERE department_name = 'Purchasing'
d. UPDATE * FROM departments SET department_name = 'Procurement', SET
manager_id = 200 HAVING department_name = 'Purchasing'
Question 7
Update the Treasury department to Cash department. And this will be managed by the Manager
of Finance department.
Select one:
a. UPDATE FROM departments SET department_name = 'Procurement', SET manager_id
= 100 HAVING department_name = 'Treasury'
b. UPDATE department_name = 'Procurement' AND manager_id = 100FROM departments
WHERE department_name = 'Treasury'
c. UPDATE department_name = 'Procurement', manager_id = 100 FROM
departmentsWHERE department_name = 'Treasury'
d. UPDATE departments SET department_name = 'Procurement', manager_id = 100
WHERE department_name = 'Treasury'
Question 8
Add a 500 pesos increase in salary of all employees who have rendered services 10 years and
above.
Select one:
a. UPDATE salary FROM employees SET salary + 500 where TO_YEAR(sysdate,'YYYY')
- TO_YEAR(hire_date,'YYYY') >= 10
b. UPDATE salary= salary + 500 where TO_DATE(sysdate,'YYYY') -
TO_DATE(hire_date,'YYYY') >= 10
c. UPDATE employees SET salary = salary + 500 where TO_CHAR(sysdate,'YYYY') -
TO_CHAR(hire_date,'YYYY') >= 10
d. UPDATE employees SET salary = salary + 500 where YEAR(sysdate,'YYYY') -
YEAR(hire_date,'YYYY') >= 10
Question 9
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:
a. INSERT FROM jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000, 18000)
b. INSERT FROM jobs SET job_id = 'DB_ADMIN', job_title= 'Database Administrator',
min_salary = 10000, max_salary=18000
c. INSERT INTO jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000, 18000)
d. INSERT * FROM jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000,
18000)
Question 10
Display all the employee id, names of employees ,job id and department nameof all employees
of the Finance Department.
Select one:
a. 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'
b. SELECT A.first_name, A.last_name, A.job_id, B.department_name FROM employees A
INNER JOIN departments B ON ( A.department_id = B.department_id) ON
B.department_name = 'Finance'
c. SELECT first_name, last_name, job_id, department_name FROM employees JOIN
department ON (department_id) WHERE department_name = 'Finance'
d. All of the choices
Started on Wednesday, 1 January 2020, 4:28 PM
State Finished
Completed on Wednesday, 1 January 2020, 4:41 PM
Time taken 12 mins 35 secs
Grade 10.00 out of 10.00 (100%)
Question 1
Question 2
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:
a. INSERT FROM jobs SET job_id = 'DB_ADMIN', job_title= 'Database Administrator',
min_salary = 10000, max_salary=18000
b. INSERT INTO jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000, 18000)
c. INSERT * FROM jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000,
18000)
d. INSERT FROM jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000, 18000)
Question 3
Question 4
Update the Treasury department to Cash department. And this will be managed by the Manager
of Finance department.
Select one:
a. UPDATE department_name = 'Procurement', manager_id = 100 FROM
departmentsWHERE department_name = 'Treasury'
b. UPDATE departments SET department_name = 'Procurement', manager_id = 100
WHERE department_name = 'Treasury'
c. UPDATE department_name = 'Procurement' AND manager_id = 100FROM departments
WHERE department_name = 'Treasury'
d. UPDATE FROM departments SET department_name = 'Procurement', SET manager_id
= 100 HAVING department_name = 'Treasury'
Question 5
Question 6
Display the location id of all employee's name and salary whose salary is from 5000 to 10000.
Select one:
a. SELECT employees.first_name, employees.last_name, employees.salary FROM
employees JOIN departments ON (department_id) WHERE employees.salary >= 5000 AND
employees.salary <= 10000
b. SELECT first_name, last_name, salary FROM employees JOIN departments USING
(department_id) WHERE MIN(salary) = 5000 AND MAX(salary) = 10000
c. SELECT employees.first_name, employees.last_name, employees.salary FROM
employees CROSS JOIN departments USING (department_id) WHERE employees.salary >=
5000 AND employees.salary <= 10000
d. SELECT first_name, last_name, salary FROM employees JOIN departments USING
(department_id) WHERE salary >= 5000 AND salary <= 10000
Question 7
Question 8
Question 9
Employee id : 200
Salary : 10000
Department of assignment : 60
Select one:
a. INSERT FROM employees
VALUES (200,'Gary','Park', TO_CHAR('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000,
103, 60)
b. INSERT FROM employees
VALUES (200,'Gary','Park',TO_DATE('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000,
103, 60)
c. 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)
d. INSERT INTO employees
(employee_id,first_name,last_name,hire_date,job_id,salary,manager_id,department_id)
VALUES (200,'Gary','Park',TO_DATE('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000,
103, 60)
Question 10
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 * INTO jobs VALUES (JAVA_DEV, Java Developer, 7000, 8000)
b. INSERT FROM jobs(jobs_id, job_title, min_salary, max_salary) VALUES
('JAVA_DEV', 'Java Developer', 7000, 8000)
c. INSERT FROM jobs SET jobs_id = ‘JAVA_DEV’, job_title = ‘Java Developer’ ,
min_salary =7000 , max_salary= 8000
d. INSERT INTO jobs VALUES ('JAVA_DEV', 'Java Developer', 7000, 8000)
Question 1
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 warehouse HAVING
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 warehouseWHERE
SUM(ONHAND) > 50
d. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse,class
HAVING SUM(ONHAND) > 50
Question 2
You want to display all the employee id and the month an employee was hired excluding
employees whose job id is AD_VP. Which SQL statement give the required output?
Select one:
a. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT = 'AD_VP';
b. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT ('AD_VP');
c. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT IN ('AD_VP');
d. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id EXCLUDE ('AD_VP');
Question 3
The General Manager request to the Database Administrator to generate the total salary per
month of every department in the company.
Select one:
a. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
b. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
c. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER
BY department_id
d. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
Question 4
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
Question 5
Aldrin wants to know the highest salary in every department. Which of the following SQL
command will display the required output?
Select one:
a. SELECT department_id, MAX(salary) FROM employees GROUP BY department_id
b. SELECT department_id, MAXIMUM(salary) FROM employees GROUP BY
department_id;
c. SELECT department_id, HIGH(salary) FROM employees GROUP BY department_id
AND salary;
d. SELECT department_id, HIGHEST(salary) FROM employees GROUP BY salary;
Question 6
John want to know how many employees receiving salary below 10,000. What SQL command
he need to run?
Select one:
a. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
b. SELECT COUNT(*) FROM employees WHERE salary < 10000;
c. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
d. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
Question 7
You want to display the employee id and the year when an employee was hired.
Question 8
Question 9
You want to display the employee's id and formatted date hired as shown below.
Required output :
Select one:
a. SELECT employee_id, TO_CHAR(hire_date, 'Month DD, YYYY') AS "Hired Date"
FROM employees;
b. SELECT employee_id, format(TO_DATE(hire_date, 'Month DD, YYYY')) AS "Hired
Date" FROM employees;
c. SELECT employee_id, TO_DATE (hire_date, 'format Month DD, YYYY') AS "Hired
Date" FROM employees;
d. SELECT employee_id, TO_CHAR(hire_date, 'fmMonth DD, YYYY') AS "Hired Date"
FROM employees;
Question 10
Display the warehouse number, class, highest price & lowest price, total on hand balance whose
class is AP.
Question 11
You want to display the employee's last name hired from year 2000 to 2002.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')
b. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-RR')
c. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2002', 'Month-‘YYYY')
d. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2002', 'YYYY')
Question 12
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
Question 13
John want to know how many part items are there in warehouse number 3.
Select one:
a. SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;
b. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
c. SELECT COUNT(*) FROM parts WHERE warehouse = 3;
d. SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;
Question 14
You want to display the employee's last name whose salary is below 10,000.
Which SQL statement give the required output format of the salary?
Required output :
Select one:
a. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000
b. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
c. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000
d. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
Question 15
You want to display the employee id and the month an employee was hired.
Required output :
Select one:
a. SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM
employees;
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month"
FROM employees;
c. SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;
d. SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM
employees;
Question 16
Which of the following SQL command will display all records with part number contains the
number 9?
Select one:
a. SELECT partnum FROM parts WHERE partnum = ‘%9%’
b. SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%9%’
c. SELECT * from parts WHERE partnum LIKE '%9%'
d. SELECT * FROM parts WHERE partnum IN ('%9%')
Question 17
You want to display the employee id, date hired of all employees whose hired date is
September.
Select one:
a. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'MON') = 'SEP'
b. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'Month') = TO_DATE(‘09’)
c. SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'MON') = 'SEP'
d. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'Month') = TO_DATE('September')
Question 18
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) GROUP BY warehouse,class
WHERE warehouse = 1 or warehouse = 2 FROM parts;
c. SELECT warehouse, class, SUM(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 AND warehouse = 2;
d. SELECT warehouse, class, COUNT(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 OR warehouse = 2;
Question 19
You want to display the last name and the year when an employee was hired whose job id is
IT_PROG.
Select one:
a. SELECT last_name, YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
b. SELECT last_name, TO_CHAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
c. SELECT last_name, TO_YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
d. SELECT last_name, YEAR(hire_date') FROM employees WHERE job_id = ‘IT_PROG’;
Question 20
What is the SQL command to display the date of the first employee that was hired?
Select one:
a. SELECT hire_date FROM employees WHERE TO_CHAR(hire_date) = ‘FIRST’;
b. SELECT FIRST(hire_date) FROM employees;
c. SELECT MIN(hire_date) FROM employees;
d. SELECT hire_date FROM employees WHERE FIRST(hire_date );
Question 1
You want to display the last name and the year when an employee was hired whose job id is
IT_PROG.
Select one:
a. SELECT last_name, TO_CHAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
b. SELECT last_name, YEAR(hire_date') FROM employees WHERE job_id = ‘IT_PROG’;
c. SELECT last_name, YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
d. SELECT last_name, TO_YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
Question 2
Correct
You want to display the employee’s last name whose salary is below 10,000 and whose
lastname starts with letter K.
Which SQL statement give the required output format of the salary?
Select one:
a. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000 WHERE last_name IN 'K%'
b. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000WHERE last_name LIKE ‘K%’
c. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000WHERE last_name = ‘K%’
d. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE last_name STARTS 'K%'
Question 3
You want to display the employee's last name and date hired in year 2002 whose salary is above
5000.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2002', 'DD-Mon-RR') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-RR') AND
salary > 5000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')AND salary ABOVE 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date <= TO_DATE('Dec-2002', 'Month-‘YYYY') AND
salary > 5,000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date >=
TO_DATE('2000', 'YYYY') AND hire_date <= TO_DATE('2002', 'YYYY') OR salary > 5000;
Question 4
The General Manager request to the Database Administrator to generate the total salary per
month of every department in the company.
Select one:
a. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
b. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
c. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
d. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER
BY department_id
Question 5
Correct
Mark 1.00 out of 1.00
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 partnum FROM parts WHERE partnum = ‘%9%’
c. SELECT * from parts WHERE partnum LIKE '%9%'
d. SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%9%’
Question 6
Aldrin wants to know the outstanding total balance on hand on every class per warehouse.
Select one:
a. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
b. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse),
sum(class);
c. SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM parts GROUP
BY warehouse, class
d. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, class
Question 7
You want to display all the employee id and the month an employee was hired excluding
employees whose job id is AD_VP. Which SQL statement give the required output?
Select one:
a. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT = 'AD_VP';
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT IN ('AD_VP');
c. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT ('AD_VP');
d. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id EXCLUDE ('AD_VP');
Question 8
You want to display the employee id and the month an employee was hired.
Select one:
a. SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM
employees;
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month"
FROM employees;
c. SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM
employees;
d. SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;
Question 9
You want to display the employee's last name whose salary is below 10,000.
Which SQL statement give the required output format of the salary?
Required output :
Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000
b. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000
c. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
d. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
Question 10
You want to display the employee's id and formatted date hired as shown below.
Required output :
Select one:
a. SELECT employee_id, TO_CHAR(hire_date, 'fmMonth DD, YYYY') AS "Hired Date"
FROM employees;
b. SELECT employee_id, TO_DATE (hire_date, 'format Month DD, YYYY') AS "Hired
Date" FROM employees;
c. SELECT employee_id, format(TO_DATE(hire_date, 'Month DD, YYYY')) AS "Hired
Date" FROM employees;
d. SELECT employee_id, TO_CHAR(hire_date, 'Month DD, YYYY') AS "Hired Date"
FROM employees;
Question 11
Aldrin wants to know the highest salary in every department. Which of the following SQL
command will display the required output?
Select one:
a. SELECT department_id, HIGHEST(salary) FROM employees GROUP BY salary;
b. SELECT department_id, HIGH(salary) FROM employees GROUP BY department_id
AND salary;
c. SELECT department_id, MAX(salary) FROM employees GROUP BY department_id
d. SELECT department_id, MAXIMUM(salary) FROM employees GROUP BY
department_id;
Question 12
You want to display the employee id, date hired of all employees whose hired date is September
.
Select one:
a. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'MON') = 'SEP'
b. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'Month') = TO_DATE('September')
c. SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'MON') = 'SEP'
d. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'Month') = TO_DATE(‘09’)
Question 13
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
WHERE class = 'AP'
GROUP BY warehouse, class
ORDER BY warehouse;
b. SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse
WHERE class = 'AP'
ORDER BY warehouse, class;
c. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class, price
ORDER BY warehouse, class
d. SELECT warehouse, class, MAX(price), MIN(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse, class
ORDER BY warehouse;
WHERE class = 'AP'
Question 14
You want to display the employee id and the year when an employee was hired.
Select one:
a. SELECT employee_id, YEAR(hire_date') FROM employees;
b. SELECT employee_id, TO_CHAR(hire_date,'YYYY') FROM employees;
c. SELECT employee_id, TO_YEAR(hire_date,'YYYY') FROM employees;
d. SELECT employee_id, YEAR(hire_date,'YYYY') FROM employees;
Question 15
Ms. Ella what to generate the average salary of all employees whose job function is IT_PROG.
Question 16
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
WHERE 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, SUM(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 AND warehouse = 2;
d. SELECT warehouse, class, count(partnum), sum(onhand) GROUP BY warehouse,class
HAVING warehouse = 1 or warehouse = 2 FROM parts;
Question 17
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 warehouse HAVING
SUM(ONHAND) > 50
b. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouseWHERE
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 WHERE SUM(ONHAND) > 50
Question 18
John want to know how many part items are there in warehouse number 3.
Select one:
a. SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;
b. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
c. SELECT COUNT(*) FROM parts WHERE warehouse = 3;
d. SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;
Question 19
Select one:
a. Invalid SQL command
b. 0 rows returned
c. 7 rows returned
d. Error
e. 2 rows returned
Question 20
John want to know how many employees receiving salary below 10,000. What SQL command
he need to run?
Select one:
a. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
b. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
c. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
d. SELECT COUNT(*) FROM employees WHERE salary < 10000;
Question 1
You want to display the employee's id and formatted date hired as shown below.
Required output :
Select one:
a. SELECT employee_id, TO_CHAR(hire_date, 'fmMonth DD, YYYY') AS "Hired Date"
FROM employees;
b. SELECT employee_id, TO_CHAR(hire_date, 'Month DD, YYYY') AS "Hired Date"
FROM employees;
c. SELECT employee_id, format(TO_DATE(hire_date, 'Month DD, YYYY')) AS "Hired
Date" FROM employees;
d. SELECT employee_id, TO_DATE (hire_date, 'format Month DD, YYYY') AS "Hired
Date" FROM employees;
Question 2
Question 3
You want to display the employee's last name whose salary is below 10,000.
Which SQL statement give the required output format of the salary?
Required output :
Select one:
a. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000
b. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000
c. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
d. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
Question 4
What is the SQL command to display the date of the first employee that was hired?
Select one:
a. SELECT hire_date FROM employees WHERE FIRST(hire_date );
b. SELECT MIN(hire_date) FROM employees;
c. SELECT hire_date FROM employees WHERE TO_CHAR(hire_date) = ‘FIRST’;
d. SELECT FIRST(hire_date) FROM employees;
Question 5
John want to know how many employees receiving salary below 10,000. What SQL command
he need to run?
Select one:
a. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
b. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
c. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
d. SELECT COUNT(*) FROM employees WHERE salary < 10000;
Question 6
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 * 1.10% FROM parts WHERE warehouse = 3
b. SELECT partnum, price, price * 0.1 FROM parts WHERE warehouse = 3
c. SELECT partnum, price, price * 1.1 FROM parts WHERE warehouse = 3
d. SELECT partnum, price, price * 10% FROM parts WHERE warehouse = 3
Question 7
You want to display the last name and the year when an employee was hired whose job id is
IT_PROG.
Select one:
a. SELECT last_name, YEAR(hire_date') FROM employees WHERE job_id = ‘IT_PROG’;
b. SELECT last_name, TO_YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
c. SELECT last_name, YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
d. SELECT last_name, TO_CHAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
Question 8
Aldrin wants to know the highest salary in every department. Which of the following SQL
command will display the required output?
Select one:
a. SELECT department_id, MAX(salary) FROM employees GROUP BY department_id
b. SELECT department_id, HIGHEST(salary) FROM employees GROUP BY salary;
c. SELECT department_id, HIGH(salary) FROM employees GROUP BY department_id
AND salary;
d. SELECT department_id, MAXIMUM(salary) FROM employees GROUP BY
department_id;
Question 9
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, SUM(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 AND warehouse = 2;
b. SELECT warehouse, class, count(partnum), sum(onhand) GROUP BY warehouse,class
WHERE warehouse = 1 or warehouse = 2 FROM parts;
c. SELECT warehouse, class, count(partnum), sum(onhand) GROUP BY warehouse,class
HAVING warehouse = 1 or warehouse = 2 FROM parts;
d. SELECT warehouse, class, COUNT(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 OR warehouse = 2;
Question 10
SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP')
AND (price > 200 AND price < 500);
Select one:
a. 0 rows returned
b. Error
c. Invalid SQL command
d. 2 rows returned
e. 7 rows returned
Question 11
Ms. Ella what to generate the average salary of all employees whose job function is IT_PROG.
Select one:
a. SELECT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';
b. SELECT AVERAGE(salary) FROM employees WHERE job_id = 'IT_PROG';
c. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';
d. SELECT AVE(salary) FROM employees WHERE job_id = 'IT_PROG';
Question 12
John want to know how many part items are there in warehouse number 3.
Select one:
a. SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;
b. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
c. SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;
d. SELECT COUNT(*) FROM parts WHERE warehouse = 3;
Question 13
Aldrin wants to know the outstanding total balance on hand on every class per warehouse.
Select one:
a. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, class
b. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse),
sum(class);
c. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
d. SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM parts GROUP
BY warehouse, class
Question 14
You want to display the employee's last name and date hired in year 2002 whose salary is above
5000.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')AND salary ABOVE 5000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date >=
TO_DATE('2000', 'YYYY') AND hire_date <= TO_DATE('2002', 'YYYY') OR salary > 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date <= TO_DATE('Dec-2002', 'Month-‘YYYY') AND
salary > 5,000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2002', 'DD-Mon-RR') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-RR') AND
salary > 5000;
Question 15
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 warehouse HAVING
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 warehouseWHERE
SUM(ONHAND) > 50
Question 16
You want to display the employee's last name hired from year 2000 to 2002.
Which SQL statement give the required output?
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-RR')
b. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2002', 'YYYY')
c. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')
d. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2002', 'Month-‘YYYY')
Question 17
Correct
You want to display the employee’s last name whose salary is below 10,000 and whose
lastname starts with letter K.
Which SQL statement give the required output format of the salary?
Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000WHERE last_name = ‘K%’
b. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000 WHERE last_name IN 'K%'
c. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000WHERE last_name LIKE ‘K%’
d. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE last_name STARTS 'K%'
Question 18
You want to display the employee id and the year when an employee was hired.
Select one:
a. SELECT employee_id, YEAR(hire_date') FROM employees;
b. SELECT employee_id, TO_CHAR(hire_date,'YYYY') FROM employees;
c. SELECT employee_id, TO_YEAR(hire_date,'YYYY') FROM employees;
d. SELECT employee_id, YEAR(hire_date,'YYYY') FROM employees;
Question 19
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 onhand
b. SELECT class, TOTAL(onhand) AS "QTY ON HAND" FROM parts GROUP BY class,
onhand
c. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY class
d. SELECT class, onhand AS "QTY ON HAND" FROM parts GROUP BY sum(onhand)
Question 20
The General Manager request to the Database Administrator to generate the total salary per
month of every department in the company.
Select one:
a. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER
BY department_id
b. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
c. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
d. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
Question 1
Aldrin wants to know the highest salary in every department. Which of the following SQL
command will display the required output?
Select one:
a. SELECT department_id, HIGH(salary) FROM employees GROUP BY department_id
AND salary;
b. SELECT department_id, MAXIMUM(salary) FROM employees GROUP BY
department_id;
c. SELECT department_id, MAX(salary) FROM employees GROUP BY department_id
d. SELECT department_id, HIGHEST(salary) FROM employees GROUP BY salary;
Question 2
John want to know how many employees receiving salary below 10,000. What SQL command
he need to run?
Select one:
a. SELECT COUNT(*) FROM employees WHERE salary < 10000;
b. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
c. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
d. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
Question 3
Which of the following SQL command will display the summary table showing the total
quantity on hand per class.
Select one:
a. SELECT class, onhand AS "QTY ON HAND" FROM parts GROUP BY sum(onhand)
b. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY onhand
c. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY class
d. SELECT class, TOTAL(onhand) AS "QTY ON HAND" FROM parts GROUP BY class,
onhand
Question 4
Question 5
SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP')
AND (price > 200 AND price < 500);
Select one:
a. Invalid SQL command
b. Error
c. 0 rows returned
d. 7 rows returned
e. 2 rows returned
Question 6
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 warehouse,class
HAVING 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 warehouseWHERE
SUM(ONHAND) > 50
d. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse HAVING
SUM(ONHAND) > 50
Question 7
Which of the following SQL command will display all records with part number contains the
number 9?
Select one:
a. SELECT partnum FROM parts WHERE partnum = ‘%9%’
b. SELECT * from parts WHERE partnum LIKE '%9%'
c. SELECT * FROM parts WHERE partnum IN ('%9%')
d. SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%9%’
Question 8
You want to display the employee’s last name whose salary is below 10,000 and whose
lastname starts with letter K.
Which SQL statement give the required output format of the salary?
Select one:
a. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE last_name STARTS 'K%'
b. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000 WHERE last_name IN 'K%'
c. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000WHERE last_name LIKE ‘K%’
d. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000WHERE last_name = ‘K%’
Question 9
Ms. Ella what to generate the average salary of all employees whose job function is IT_PROG.
Select one:
a. SELECT AVERAGE(salary) FROM employees WHERE job_id = 'IT_PROG';
b. SELECT AVE(salary) FROM employees WHERE job_id = 'IT_PROG';
c. SELECT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';
d. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';
Question 10
You want to display the employee id, date hired of all employees whose hired date is
September.
Select one:
a. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'Month') = TO_DATE('September')
b. SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'MON') = 'SEP'
c. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'MON') = 'SEP'
d. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'Month') = TO_DATE(‘09’)
Question 11
You want to display the employee's last name and date hired in year 2002 whose salary is above
5000.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date >=
TO_DATE('2000', 'YYYY') AND hire_date <= TO_DATE('2002', 'YYYY') OR salary > 5000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')AND salary ABOVE 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2002', 'DD-Mon-RR') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-RR') AND
salary > 5000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date <= TO_DATE('Dec-2002', 'Month-‘YYYY') AND
salary > 5,000;
Question 12
Aldrin wants to know the outstanding total balance on hand on every class per warehouse.
Select one:
a. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse),
sum(class);
b. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
c. SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM parts GROUP
BY warehouse, class
d. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, class
Question 13
You want to display the employee's id and formatted date hired as shown below.
Required output :
Select one:
a. SELECT employee_id, TO_CHAR(hire_date, 'fmMonth DD, YYYY') AS "Hired Date"
FROM employees;
b. SELECT employee_id, format(TO_DATE(hire_date, 'Month DD, YYYY')) AS "Hired
Date" FROM employees;
c. SELECT employee_id, TO_CHAR(hire_date, 'Month DD, YYYY') AS "Hired Date"
FROM employees;
d. SELECT employee_id, TO_DATE (hire_date, 'format Month DD, YYYY') AS "Hired
Date" FROM employees;
Question 14
You want to display the employee id and the month an employee was hired.
Required output :
Select one:
a. SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM
employees;
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month"
FROM employees;
c. SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;
d. SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM
employees;
Question 15
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
WHERE class = 'AP'
GROUP BY warehouse, class, price
ORDER BY warehouse, class
b. SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse
WHERE class = 'AP'
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, MAX(price), MIN(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse, class
ORDER BY warehouse;
WHERE class = 'AP'
Question 16
You want to display all the employee id and the month an employee was hired excluding
employees whose job id is AD_VP. Which SQL statement give the required output?
Select one:
a. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT ('AD_VP');
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT IN ('AD_VP');
c. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id EXCLUDE ('AD_VP');
d. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT = 'AD_VP';
Question 17
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 * 10% FROM parts WHERE warehouse = 3
b. SELECT partnum, price, price * 0.1 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
Question 18
What is the SQL command to display the date of the first employee that was hired?
Select one:
a. SELECT FIRST(hire_date) FROM employees;
b. SELECT hire_date FROM employees WHERE TO_CHAR(hire_date) = ‘FIRST’;
c. SELECT MIN(hire_date) FROM employees;
d. SELECT hire_date FROM employees WHERE FIRST(hire_date );
Question 19
You want to display the employee's last name whose salary is below 10,000.
Which SQL statement give the required output format of the salary?
Required output :
Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000
b. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
c. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000
d. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000
Question 20
You want to display the employee's last name hired from year 2000 to 2002.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')
b. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-RR')
c. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2002', 'YYYY')
d. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2002', 'Month-‘YYYY')
Question 1
John want to know how many part items are there in warehouse number 3.
Select one:
a. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
b. SELECT COUNT(*) FROM parts WHERE warehouse = 3;
c. SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;
d. SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;
Question 2
You want to display the employee’s last name whose salary is below 10,000 and whose
lastname starts with letter K.
Which SQL statement give the required output format of the salary?
Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10,000WHERE last_name = ‘K%’
b. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE last_name STARTS 'K%'
c. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000WHERE last_name LIKE ‘K%’
d. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY"
FROM employees WHERE salary < 10000 WHERE last_name IN 'K%'
Question 3
You want to display the last name and the year when an employee was hired whose job id is
IT_PROG.
Select one:
a. SELECT last_name, YEAR(hire_date') FROM employees WHERE job_id = ‘IT_PROG’;
b. SELECT last_name, YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
c. SELECT last_name, TO_YEAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
d. SELECT last_name, TO_CHAR(hire_date,'YYYY') FROM employees WHERE job_id =
‘IT_PROG’;
Question 4
SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP')
AND (price > 200 AND price < 500);
Select one:
a. 0 rows returned
b. Error
c. Invalid SQL command
d. 7 rows returned
e. 2 rows returned
Question 5
You want to display the employee's last name hired from year 2000 to 2002.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2002', 'Month-‘YYYY')
b. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-RR')
c. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2002', 'YYYY')
d. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')
Question 6
Display the warehouse number, class, highest price & lowest price, total on hand balance whose
class is AP.
Select one:
a. SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse
WHERE class = 'AP'
ORDER BY warehouse, class;
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
GROUP BY warehouse, class
ORDER BY warehouse;
WHERE class = 'AP'
d. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class
ORDER BY warehouse;
Question 7
Ms. Ella what to generate the average salary of all employees whose job function is IT_PROG.
Select one:
a. SELECT AVE(salary) FROM employees WHERE job_id = 'IT_PROG';
b. SELECT AVERAGE(salary) FROM employees WHERE job_id = 'IT_PROG';
c. SELECT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';
d. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';
Question 8
You want to display all the employee id and the month an employee was hired excluding
employees whose job id is AD_VP. Which SQL statement give the required output?
Select one:
a. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id EXCLUDE ('AD_VP');
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT IN ('AD_VP');
c. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT = 'AD_VP';
d. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT ('AD_VP');
Question 9
Aldrin wants to know the outstanding total balance on hand on every class per warehouse.
Select one:
a. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse),
sum(class);
b. SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM parts GROUP
BY warehouse, class
c. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, class
d. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
Question 10
You want to display the employee id and the month an employee was hired.
Required output :
Select one:
a. SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM
employees;
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month"
FROM employees;
c. SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;
d. SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM
employees;
Question 11
Which of the following SQL command will display the summary table showing the total
quantity on hand per class.
Select one:
a. SELECT class, TOTAL(onhand) AS "QTY ON HAND" FROM parts GROUP BY class,
onhand
b. SELECT class, onhand AS "QTY ON HAND" FROM parts GROUP BY sum(onhand)
c. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY class
d. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY onhand
Question 12
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, SUM(partnum), SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 AND warehouse = 2;
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
HAVING warehouse = 1 or warehouse = 2 FROM parts;
d. SELECT warehouse, class, count(partnum), sum(onhand) GROUP BY warehouse,class
WHERE warehouse = 1 or warehouse = 2 FROM parts;
Question 13
You want to display the employee id, date hired of all employees whose hired date is
September.
Select one:
a. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'MON') = 'SEP'
b. SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'MON') = 'SEP'
c. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date, 'Month') = TO_DATE(‘09’)
d. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_CHAR(hire_date, 'Month') = TO_DATE('September')
Question 14
You want to display the employee id and the year when an employee was hired.
Select one:
a. SELECT employee_id, YEAR(hire_date') FROM employees;
b. SELECT employee_id, TO_YEAR(hire_date,'YYYY') FROM employees;
c. SELECT employee_id, YEAR(hire_date,'YYYY') FROM employees;
d. SELECT employee_id, TO_CHAR(hire_date,'YYYY') FROM employees;
Question 15
What is the SQL command to display the date of the first employee that was hired?
Select one:
a. SELECT hire_date FROM employees WHERE TO_CHAR(hire_date) = ‘FIRST’;
b. SELECT hire_date FROM employees WHERE FIRST(hire_date );
c. SELECT FIRST(hire_date) FROM employees;
d. SELECT MIN(hire_date) FROM employees;
Question 16
You want to display the employee's last name and date hired in year 2002 whose salary is above
5000.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2000', 'DD-Mon-YYYYY') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-
YYYY')AND salary ABOVE 5000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-
Jan-2002', 'DD-Mon-RR') AND hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-RR') AND
salary > 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date >=
TO_DATE('2000', 'YYYY') AND hire_date <= TO_DATE('2002', 'YYYY') OR salary > 5000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('Jan-
2000', 'Month-YYYY') AND hire_date <= TO_DATE('Dec-2002', 'Month-‘YYYY') AND
salary > 5,000;
Question 17
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 * 1.1 FROM parts WHERE warehouse = 3
b. SELECT partnum, price, price * 10% FROM parts WHERE warehouse = 3
c. SELECT partnum, price, price * 0.1 FROM parts WHERE warehouse = 3
d. SELECT partnum, price, price * 1.10% FROM parts WHERE warehouse = 3
Question 18
The General Manager request to the Database Administrator to generate the total salary per
month of every department in the company.
Select one:
a. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
b. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER
BY department_id
c. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
d. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
Question 19
What will be the output of the SQL command?
SELECT SUM(onhand) FROM PARTS where class = 'HW' OR class = 'AP' AND warehouse =
1;
Select one:
a. 178
b. 137
c. 44
d. 85
Question 20
Which of the following SQL command will display all records with part number contains the
number 9?
Select one:
a. SELECT partnum FROM parts WHERE partnum = ‘%9%’
b. SELECT * from parts WHERE partnum LIKE '%9%'
c. SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%9%’
d. SELECT * FROM parts WHERE partnum IN ('%9%')
Question 1
Question 2
Question 3
Matt wants to change his password from 1234 to abcd.
Which of the following will perform the task?
Select one:
a. UPDATE PASSWORD 1234 TO abcd FROM matt
b. CHANGE USER matt PASSWORD abcd
c. ALTER USER matt IDENTIFIED abcd;
d. User matt cannot change his password. DBA has only the rights to change the password
e. UPDATE matt WITH abcd
Question 4
These are privileges that performs a particular action within the database.
Select one:
a. Network Privileges
b. System Privileges
c. Connection Privileges
d. Object Privileges
Question 5
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. Re-encode the data
b. Run the ROLLBACK command
c. None of the choices
d. Execute the UNDELETE command
e. Restore the backup copy
Question 6
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
Question 7
This has the highest level of privileges for task such as creating new users, removing users and
tables and backing up tables.
Select one:
a. Owner
b. SQL Developer
c. DBA
d. Manager
Question 8
Question 9
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. FULL OUTER JOIN
b. NATURAL JOIN
c. INNER JOIN
d. OUTER JOIN
Question 10
TRUE OR FALSE.
Multiple fields in NOT allowed in a Foreign key.
Select one:
True
False
Question 11
Which of the following SQL command that the DBA will run to provide Matt to create a table
in the Oracle Database.
Select one:
a. GRANT matt create table
b. GRANT create table TO matt
c. GRANT matt TO create table
d. GRANT ACCESS matt TO create table
Question 12
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 users can view the results.
c. Locks on the affected rows are released; those rows are available for other users to
manipulate.
d. Data changes are saved in the database.
e. None of the choices
f. All savepoints are erased.
Question 13
Question 14
You want to cancel the privilege of matt to retrieve records from the employees table.
Select one:
a. REVOKE select ON employees FROM matt;
b. REVOKE matt FROM employees TO select;
c. REVOKE select ON matt FROM employees;
d. REVOKE employees FROM matt TO select;
Question 15
Question 16
Question 17
TRUE OR FALSE.
The INSERT statement can add multiple rows.
Select one:
True
False
Question 18
The DBA will create a new user name sales.
Select one:
a. CREATE USER sales IDENTIFIED BY 1234
b. None of the choices
c. CREATE sales ACCESS 1234
d. CREATE USERNAME sales SET PASSWORD default
e. CREATE USER FR0M DB_USER SET user=’sales’ password=NULL
Question 19
Which of the following will erase all records in the departments table
Select one:
a. TRUNCATE FROM TABLE departments
b. DELETE * FROM departments
c. DELETE FROM departments
d. TRUNCATE TABLE departments
Question 20
Question 1
You want to cancel the privilege of matt to add records from the employees table.
Select one:
a. REVOKE insert ON employees FROM matt;
b. REVOKE employees FROM matt TO insert;
c. REVOKE insert ON matt FROM employees;
d. REVOKE matt FROM employees TO insert;
Question 2
Question 3
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. Missing
b. Matched
c. Unmatched
d. Intersect
Question 4
Question 5
Which of the following will grant a query privileges on the STUDENT table
Select one:
a. GRANT select ON student TO matt
b. GRANT select TO matt ON student
c. GRANT matt TO select student
d. GRANT matt PRIVILEGE select TO student
Question 6
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Select one:
a. The folllowing will grant object privileges on USER user1
b. The SQL command is incorrect
c. None of the choices
d. The following will grant query privileges on the DEPARTMENTS table:
Question 8
Select one:
a. Creates a temporary table with department = 60
b. Locks the rows in the EMPLOYEES table with department id is 60.
c. Unlock all records with department id = 60
d. All users accessing the department id 60 can accept UPDATE command simultaneously.
Question 9
Question 10
Question text
Question 11
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. Restore the backup copy
b. Run the ROLLBACK command
c. Re-encode the data
d. None of the choices
e. Execute the UNDELETE command
Question 12
Question 13
Question 14
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:
a. CREATE USER matt IDENTIFIED BY 1234
b. CREATE USERNAME matt PASSWORD 1234
c. None of the choices
d. CREATE matt ACCESS 1234
e. CREATE USER FR0M DB_USER SET user
Question 15
TRUE OR FALSE.
The INSERT statement can add multiple rows.
Select one:
True
False
Question 16
Which of the following command will delete all records in the table employees
Select one:
a. DELETE ALL FROM employees
b. DELETE FROM employees
c. DELETE employees WHERE ORASYS_REC > 0
d. DELETE ALL RECORDS employees
Question 17
TRUE OR FALSE.
An owner has all the privileges on the object.
Select one:
True
False
Question 18
Question 19
Question 20
This has the highest level of privileges for task such as creating new users, removing users and
tables and backing up tables.
Select one:
a. Owner
b. DBA
c. SQL Developer
d. Manager
Started on Wednesday, 1 January 2020, 7:14 PM
State Finished
Completed on Wednesday, 1 January 2020, 7:20 PM
Time taken 6 mins 3 secs
Grade 19.00 out of 20.00 (95%)
Question 1
Question 2
Question 3
Select one:
a. All users accessing the department id 60 can accept UPDATE command simultaneously.
b. Unlock all records with department id = 60
c. Creates a temporary table with department = 60
d. Locks the rows in the EMPLOYEES table with department id is 60.
Question 4
Which of the following will erase all records in the departments table
Select one:
a. TRUNCATE TABLE departments
b. TRUNCATE FROM TABLE departments
c. DELETE FROM departments
d. DELETE * FROM departments
Question 5
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
Question 6
Which of the following will grant a query privileges on the STUDENT table
Select one:
a. GRANT select ON student TO matt
b. GRANT select TO matt ON student
c. GRANT matt TO select student
d. GRANT matt PRIVILEGE select TO student
Question 7
Question 8
You want to cancel the privilege of matt to add records from the employees table.
Select one:
a. REVOKE insert ON employees FROM matt;
b. REVOKE matt FROM employees TO insert;
c. REVOKE employees FROM matt TO insert;
d. REVOKE insert ON matt FROM employees;
Question 9
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Select one:
a. The folllowing will grant object privileges on USER user1
b. None of the choices
c. The SQL command is incorrect
d. The following will grant query privileges on the DEPARTMENTS table:
Question 10
A Database Administrator can create and remove users and tables.
Select one:
a. The statement is incorrect. Only users of the database can be created by the Database
Administrator.
b. The information is insufficient.
c. 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.
d. The statement is correct
Question 11
Question 12
Question 13
Question 14
Which of the following command will delete all records in the table employees
Select one:
a. DELETE FROM employees
b. DELETE ALL RECORDS employees
c. DELETE ALL FROM employees
d. DELETE employees WHERE ORASYS_REC > 0
Question 15
You want to cancel the privilege of matt to retrieve records from the employees table.
Select one:
a. REVOKE matt FROM employees TO select;
b. REVOKE select ON employees FROM matt;
c. REVOKE select ON matt FROM employees;
d. REVOKE employees FROM matt TO select;
Question 16
Which of the following SQL command that the DBA will run to provide Matt to create a table
in the Oracle Database.
Select one:
a. GRANT matt TO create table
b. GRANT ACCESS matt TO create table
c. GRANT matt create table
d. GRANT create table TO matt
Question 17
Question 18
TRUE OR FALSE.
Multiple fields in NOT allowed in a Foreign key.
Select one:
True
False
Question 19
Question 20
Which of the following DOES NOT describes the state of the data after the COMMIT
command
Select one:
a. All savepoints are erased.
b. All users can view the results.
c. Data changes are saved in the database.
d. None of the choices
e. The previous state of the data is overwritten.
f. Locks on the affected rows are released; those rows are available for other users to
manipulate.
Question 1
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. Re-encode the data
d. Run the ROLLBACK command
e. Execute the UNDELETE command
Question 2
Question 3
Correct
Mark 1.00 out of 1.00
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. Matched
b. Unmatched
c. Intersect
d. Missing
Question 4
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:
a. CREATE USER matt IDENTIFIED BY 1234
b. None of the choices
c. CREATE USERNAME matt PASSWORD 1234
d. CREATE USER FR0M DB_USER SET user
e. CREATE matt ACCESS 1234
Question 5
Question 6
You want to cancel the privilege of matt to add records from the employees table.
Select one:
a. REVOKE matt FROM employees TO insert;
b. REVOKE employees FROM matt TO insert;
c. REVOKE insert ON employees FROM matt;
d. REVOKE insert ON matt FROM employees;
Question 7
This has the highest level of privileges for task such as creating new users, removing users and
tables and backing up tables.
Select one:
a. DBA
b. SQL Developer
c. Manager
d. Owner
Question 8
Question 9
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. FULL OUTER JOIN
d. OUTER JOIN
Question 10
Question 11
You want to cancel the privilege of matt to retrieve records from the employees table.
Select one:
a. REVOKE select ON employees FROM matt;
b. REVOKE matt FROM employees TO select;
c. REVOKE employees FROM matt TO select;
d. REVOKE select ON matt FROM employees;
Question 12
Which of the following will grant a query privileges on the STUDENT table
Select one:
a. GRANT matt TO select student
b. GRANT select ON student TO matt
c. GRANT select TO matt ON student
d. GRANT matt PRIVILEGE select TO student
Question 13
These are collection of objects such as tables, views, and sequences.
Select one:
a. Class
b. Schema
c. Container
d. Model
Question 14
Question 15
Question 16
Question 17
Select one:
a. CREATE USERNAME sales SET PASSWORD default
b. CREATE sales ACCESS 1234
c. None of the choices
d. CREATE USER FR0M DB_USER SET user=’sales’ password=NULL
e. CREATE USER sales IDENTIFIED BY 1234
Question 18
TRUE OR FALSE.
An owner has all the privileges on the object.
Select one:
True
False
Question 19
These are privileges that performs a particular action within the database.
Select one:
a. Network Privileges
b. Object Privileges
c. System Privileges
d. Connection Privileges
Question 20
Which of the following SQL command that the DBA will run to provide Matt to create a table
in the Oracle Database.
Select one:
a. GRANT ACCESS matt TO create table
b. GRANT matt TO create table
c. GRANT create table TO matt
d. GRANT matt create table
Question 2
TRUE OR FALSE.
The INSERT statement can add multiple rows.
Select one:
True
False
Question 3
Question 4
Question 5
Select one:
a. None of the choices
b. CREATE USER sales IDENTIFIED BY 1234
c. CREATE sales ACCESS 1234
d. CREATE USERNAME sales SET PASSWORD default
e. CREATE USER FR0M DB_USER SET user=’sales’ password=NULL
Question 6
Which of the following SQL command that the DBA will run to provide Matt to create a table
in the Oracle Database.
Select one:
a. GRANT matt TO create table
b. GRANT create table TO matt
c. GRANT ACCESS matt TO create table
d. GRANT matt create table
Question 7
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. Restore the backup copy
b. Run the ROLLBACK command
c. Re-encode the data
d. Execute the UNDELETE command
e. None of the choices
Question 8
Question 9
Question 10
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Select one:
a. None of the choices
b. The SQL command is incorrect
c. The folllowing will grant object privileges on USER user1
d. The following will grant query privileges on the DEPARTMENTS table:
Question 11
TRUE OR FALSE.
Multiple fields in NOT allowed in a Foreign key.
Select one:
True
False
Question 12
Question 13
Question 14
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. Intersect
b. Matched
c. Unmatched
d. Missing
Question 15
Question 16
Question 17
Question 18
Question 19
Question 20
Which of the following DOES NOT describes the state of the data after the COMMIT
command
Select one:
a. Data changes are saved in the database.
b. All savepoints are erased.
c. None of the choices
d. All users can view the results.
e. The previous state of the data is overwritten.
f. Locks on the affected rows are released; those rows are available for other users to
manipulate.
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:
a. None of the choices
b. CREATE USER FR0M DB_USER SET user
c. CREATE USERNAME matt PASSWORD 1234
d. CREATE matt ACCESS 1234
e. CREATE USER matt IDENTIFIED BY 1234
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 FROM employees WHERE job_id = 'IT_PROG'
AND MOD(salary, 3000)
b. SELECT employee_id, job_id, salary FROM employees WHERE job_id = 'IT_PROG'
AND salary/3000
c. SELECT employee_id, job_id, salary, salary/3000 FROM employees WHERE job_id =
'IT_PROG'
d. SELECT employee_id, job_id, salary, REM(salary/3000) FROM employees WHERE
job_id = 'IT_PROG'
e. SELECT employee_id, job_id, salary, MOD(salary, 3000) FROM employees WHERE
job_id = 'IT_PROG'
Question 1
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
ORDER BY warehouse;
c. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class, price
ORDER BY warehouse, class
d. SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse
WHERE class = 'AP'
ORDER BY warehouse, class;
Question 2
Which of the following will erase all records in the departments table
Select one:
a. TRUNCATE FROM TABLE departments
b. DELETE FROM departments
c. TRUNCATE TABLE departments
d. DELETE * FROM departments
Question 3
Which of the following is the correct report that will display the CLASS from table PARTS.
Select one:
a. SELECT * CLASS FROM PARTS;
b. SELECT CLASS AS CLASS FROM PARTS;
c. SELECT 'CLASS' FROM PARTS;
d. SELECT CLASS FROM PARTS;
Question 4
Which of the following SQL command will display the summary table showing the total quantity on hand per
class.
Select one:
a. SELECT class, TOTAL(onhand) AS "QTY ON HAND" FROM parts GROUP BY class, onhand
b. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY onhand
c. SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY class
d. SELECT class, onhand AS "QTY ON HAND" FROM parts GROUP BY sum(onhand)
Question 5
Which of the following command will delete all records in the table employees
Select one:
a. DELETE ALL RECORDS employees
b. DELETE FROM employees
c. DELETE employees WHERE ORASYS_REC > 0
d. DELETE ALL FROM employees
Question 6
Question 7
Select one:
a. Unlock all records with department id = 60
b. Creates a temporary table with department = 60
c. Locks the rows in the EMPLOYEES table with department id is 60.
d. All users accessing the department id 60 can accept UPDATE command simultaneously.
Question 8
Which of the following SELECT statement is the correct PL/SQL that will display all rows and columns?
Select one:
a. SELECT ALL FROM PARTS;
b. SELECT FROM TABLE PARTS;
c. SELECT TABLE PARTS;
d. SELECT * FROM PARTS;
Question 9
You what to generate the average salary of all employees whose job function is FI_ACCOUNT.
Select one:
a. SELECT AVE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
b. SELECT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
c. SELECT AVERAGE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
d. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
Question 10
You want to cancel the privilege of matt to retrieve records from the employees table.
Select one:
a. REVOKE select ON employees FROM matt;
b. REVOKE employees FROM matt TO select;
c. REVOKE select ON matt FROM employees;
d. REVOKE matt FROM employees TO select;
Question 11
Which of the following SQL command that the DBA will run to provide Matt to create a table in the Oracle
Database.
Select one:
a. GRANT ACCESS matt TO create table
b. GRANT create table TO matt
c. GRANT matt create table
d. GRANT matt TO create table
Question 12
Question 13
Question 14
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
Question 15
Display the first 5 letter in the surname of all the employees whose firstname starts with letter 'N'
Select one:
a. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN
'N'
b. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE first_name IN 'N'
c. SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE first_name = 'N'
d. SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN
'N'
e. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) =
'N'
Question 16
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;
Question 17
You want to display the employee id, date hired of all employees whose hired date is September.
Select one:
a. SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_DATE(hire_date, 'MON') = 'SEP'
b. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_CHAR(hire_date, 'Month') = TO_DATE('September')
c. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_CHAR(hire_date, 'MON') = 'SEP'
d. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_DATE(hire_date, 'Month') = TO_DATE(‘09’)
Question 18
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 ORDER BY department_id WHERE
first_name LIKE 'D%' and job_id = 'IT_PROG'
b. SELECT employee_id, first_name, last_name FROM employees WHERE job_id = 'IT_PROG' OR
first_name LIKE 'D%' and ORDER BY department_id
c. SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE 'D%' and
job_id = 'IT_PROG' ORDER BY department_id
d. SELECT employees FROM employee_id, first_name, last_name WHERE first_name LIKE ‘D%’ and
job_id = ‘IT_PROG’ ORDER BY department_id
Question 19
You want to display the employee’s last name whose salary is below 10,000 and whose lastname starts with
letter K.
Which SQL statement give the required output format of the salary?
Select one:
a. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000 WHERE last_name IN 'K%'
b. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees
WHERE salary < 10000WHERE last_name LIKE ‘K%’
c. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000WHERE last_name = ‘K%’
d. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees
WHERE salary < 10,000 WHERE last_name STARTS 'K%'
Question 20
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 partnum FROM COUNT(parts)WHERE warehouse = 3;
d. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
Question 21
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:
a. SELECT CONCAT(last_name, first_name) FROM employees
b. SELECT CONCAT(last_name, first_name) AS Fullname FROM employees;
c. SELECT CONCAT(last_name, ',', first_name) AS Fullname FROM employees
d. SELECT CONCAT(CONCAT(last_name, ','), first_name) AS Fullname FROM employees;
Question 22
Display the employee's name, job title, job_id and the department name of employees with department id of
100.
Select one:
a. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM employees E
JOIN department D ON E.job_id = J.job_id
JOIN jobs J ON E.department_id = D.department_id
WHERE E.department_id = 100
b. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J
NATURAL JOIN department D ON E.job_id = J.job_id
NATURAL JOIN employees E ON E.department_id = D.department_id
WHERE E.department_id = 100
c. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J
INNER JOIN department D ON E.job_id = J.job_id
INNER JOIN employees EON E.department_id = D.department_id
WHERE E.department_id = 100
d. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM employees E
JOIN jobs J ON E.job_id = J.job_id
JOIN departments D ON E.department_id = D.department_id
WHERE E.department_id = 100
Question 23
Question 24
What will be the SQL command if every employee will be given a productivity bonus which is equivalent to
3% of the monthly salary?
Display the employee id, salary and the productivity bonus.
Select one:
a. SELECT employee_id, salary FROM employees WHERE salary)
b. SELECT employee_id, salary, salary + (salary .03) FROM employees
c. SELECT employee_id, salary, salary * 1.03 FROM employees
d. SELECT employee_id, salary, salary * .03 FROM employees
e. SELECT employee_id, salary, salary * .30 FROM employees
Question 25
Which of the following SELECT statement is the correctreport that will combine the column PARTNUM and
DESCRIPTION put a literal character string "belongs to" in between the two columns then rename the column
as "NUMBER TITLE". Note put space before and after the character literal string to avoid no spaces in the
report.
Select one:
a. SELECT (PARTNUM|| THAT BELONGS TO ||DESCRIPTION) AS "NUMBER TITLE" FROM
PARTS;
b. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS "NUMBER TITLE" FROM
PARTS;
c. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS NUMBER TITLE FROM
PARTS;
d. SELECT (;PARTNUM'||' THAT BELONGS TO '||'DESCRIPTION;) AS "NUMBER TITLE" FROM
PARTS;
Question 26
Question 27
Austin David was transferred to Purchasing Department. You are assigned to update the database.
Select one:
a. UPDATE department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’
b. UPDATE employees SET department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’
c. UPDATE first_name = ‘David’ AND last_name = ‘Austin’ FROM employees SET department_id = 30
d. UPDATE employees WHERE department_id = 30 SET first_name = ‘David’ AND last_name = ‘Austin’
Question 28
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 warehouse HAVING
SUM(ONHAND) > 50
b. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouseWHERE
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 WHERE SUM(ONHAND) > 50
Question 29
You want to generate the total salary per month of every department in the company.
Select one:
a. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
b. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
c. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
d. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER BY department_id
Question 30
Using Data Manipulation Language, you can ADD columns in the table.
Select one:
True
False
Question 31
You want to display the employee id and the month an employee was hired.
Required output :
Select one:
a. SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM employees;
b. SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM employees;
c. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month" FROM employees;
d. SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;
Question 32
Question 33
Question 34
Which of the following SQL commands will display all stocks whose class is HW or AP.
Select one:
a. SELECT * FROM parts WHERE IN (class = ‘HW’, class= ‘AP’);
b. SELECT * FROM parts WHERE class IN ('HW', 'AP');
c. SELECT ALL FROM parts WHERE IN class = (‘HW’, ‘AP’);
d. SELECT * FROM parts WHERE IN class ('HW', 'AP');
e. SELECT ALL FROM class WHERE parts IN = (‘HW’, ‘AP’);
Question 35
What is the SQL command to count the number of records in the employees table?
Select one:
a. SELECT ALL FROM employees
b. SELECT * FROM employees;
c. SELECT COUNT(*) FROM employees
d. SELECT SUM(*) FROM employees;
Question 36
John want to know how many employees receiving salary below 10,000.
Select one:
a. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
b. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
c. SELECT COUNT(*) FROM employees WHERE salary < 10000;
d. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
Question 37
Display all location id between 1000 to 2000.
Select one:
a. DISPLAY location_id FROM departments WHERE location_id LING 1000 UP TO 2000
b. SELECT location_id FROM departments WHERE location_id BETWEEN 1000 AND 2000
c. SELECT location_id FROM departments WHERE location_id IN 1000 AND 2000
d. DISPLAY location_id FROM departments WHERE location_id BETWEEN 1000 TO 2000
Question 38
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 partnum, 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 * FROM parts WHERE partnum LIKE 'K%';
f. SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE 'K%';
g. SELECT partnumber, description, warehouse FROM parts WHERE partnum LIKE 'K*';
Question 39
You want to display the employee's last name whose salary is below 10,000 and whose lastname starts with
letter D.
Which SQL statement give the required output format of the salary?
Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE last_name = ‘D%’
b. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees
WHERE salary < 10000 WHERE last_name LIKE 'D%'
c. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000 WHERE last_name IN 'D%'
d. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees
WHERE salary < 10,000 WHERE last_name STARTS 'D%'
Question 40
These are privileges that performs a particular action within the database.
Select one:
a. Network Privileges
b. Connection Privileges
c. System Privileges
d. Object Privileges
Question 41
The General Manager request to the Database Administrator to generate the total salary per month of every
department in the company.
Select one:
a. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER BY department_id
b. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
c. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
d. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
Question 42
Question 43
SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP') AND (price >
200 AND price < 500);
Select one:
a. 7 rows returned
b. Invalid SQL command
c. 0 rows returned
d. 2 rows returned
e. Error
Question 44
Display the lastname of every employee in the company. Display the output in a single column and label it as
Fullname
Format: JuanReyes
Select one:
a. SELECT CONCAT(first_name, last_name) FROM employees
b. SELECT CONCATENATE(first_name, last_name) AS Fullname FROM employees
c. SELECT CONCAT(first_name, last_name) AS Fullname FROM employees
d. None of the choices
Question 45
You want to display the employee's last name and date hired in year 2000 to2006 whose salary is above 5000.
Which SQL statement give the required output?
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('Jan-2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') AND
salary > 5,000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-
YYYY') AND salary ABOVE 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2006', 'YYYY') OR salary > 5000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR') AND
salary > 5000;
Question 46
You want to display all the job position titles whose salary is salary from 5,000 to 12,000 arrange from highest
to lowest
Select one:
a. SELECT job_title FROM jobs WHERE salary >= 5000 AND salary <= 10000
b. SELECT job_title FROM jobs WHERE min_salary >= 5000 AND max_salary<= 10000
c. SELECT employees_id, job_title FROM employees WHERE salary >= 5000 AND salary <= 10000
d. SELECT job_title FROM employees WHERE salary >= 5000 AND salary <= 10000
Question 47
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 FROM employee 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,salary, department_id FROM employees WHERE salary < 5000 AND
department_id IN (60,100)
Question 48
Display the employee id, salary, number of years and the hiring date of every employee in the company.
Select one:
a. SELECT employee_id, salary, hire_date, hire_date /365 FROM employees;
b. SELECT employee_id, salary, hire_date, ROUND((SYSDATE - hire_date) /365,0) FROM employees;
c. SELECT employee_id,salary, hire_date, hire_date- SYSDATE /365 FROM employees;
Question 49
Display all the records in the employee table. Arrange the output in by lastname from A-Z order.
Select one:
a. SELECT * FROM employees SORT BY lastname ascending
b. SELECT * FROM employees ORDER BY lastname AZ
c. SELECT * FROM employees SORT BY lastname
d. SELECT * FROM employees ORDER BY lastname
Question 50
You want to display all the employee id and the month an employee was hired.
Which SQL statement give the required output?
Select one:
a. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month", job_id FROM
employees
b. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month", job_id FROM
employees
c. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month", job_id FROM
employees
d. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month", job_id FROM
Question 1
Which of the following SELECT statement is the correct report that will deduct 5 from ONHAND, multiply 5
in WAREHOUSE, after getting the value on both ONHAND and WAREHOUSE add their data: as shown
below: ONHAND - 5 + 5 * WAREHOUSE
Note that you have to force the Oracle to prioritize first the Subtraction over Multiplication. List only the
column DESCRIPTION, ONHAND and WAREHOUSE.
Select one:
a. SELECT ONHAND-5 + 5 * WAREHOUSE, DESCRIPTION FROM PARTS;
b. SELECT (ONHAND-5) + 5 * WAREHOUSE, DESCRIPTION FROM PARTS;
c. SELECT ONHAND-5 + 5 (* WAREHOUSE), DESCRIPTION FROM PARTS;
d. SELECT (ONHAND-5) + 5(* WAREHOUSE), DESCRIPTION FROM PARTS;
Question 2
Question 3
Display the employee id, salary, number of years and the hiring date of every employee in the company.
Select one:
a. SELECT employee_id, salary, hire_date, ROUND((SYSDATE - hire_date) /365,0) FROM employees;
b. SELECT employee_id, salary, hire_date, hire_date /365 FROM employees;
c. SELECT employee_id,salary, hire_date, hire_date- SYSDATE /365 FROM employees;
Question 4
Which of the following SQL command will display all records with part number contains the number 9?
Select one:
a. SELECT partnum FROM parts WHERE partnum = ‘%9%’
b. SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%9%’
c. SELECT * from parts WHERE partnum LIKE '%9%'
d. SELECT * FROM parts WHERE partnum IN ('%9%')
Question 5
Question 6
Question 7
This has the highest level of privileges for task such as creating new users, removing users and tables and
backing up tables.
Select one:
a. Owner
b. Manager
c. SQL Developer
d. DBA
Question 8
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;
Question 9
You what to generate the average salary of all employees whose job function is FI_ACCOUNT.
Select one:
a. SELECT AVE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
b. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
c. SELECT AVERAGE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
d. SELECT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
Question 10
Select one:
a. CREATE USER sales IDENTIFIED BY 1234
b. None of the choices
c. CREATE USERNAME sales SET PASSWORD default
d. CREATE USER FR0M DB_USER SET user=’sales’ password=NULL
e. CREATE sales ACCESS 1234
Question 11
Question 12
You want to display the employee id and the year when an employee was hired.
Select one:
a. SELECT employee_id, YEAR(hire_date,'YYYY') FROM employees;
b. SELECT employee_id, TO_YEAR(hire_date,'YYYY') FROM employees;
c. SELECT employee_id, YEAR(hire_date') FROM employees;
d. SELECT employee_id, TO_CHAR(hire_date,'YYYY') FROM employees;
Question 13
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, onhand FROM parts GROUP BY warehouse, class
c. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse), sum(class);
d. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
Question 14
Question 15
What is the SQL command to count the number of records in the employees table?
Select one:
a. SELECT * FROM employees;
b. SELECT ALL FROM employees
c. SELECT SUM(*) FROM employees;
d. SELECT COUNT(*) FROM employees
Question 16
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:
a. SELECT employee_id, salary, salary * 1.50% AS Bonus FROM employees
b. SELECT employee_id, salary, salary * 150 AS "Bonus" FROM employees
c. SELECT employee_id, salary, salary * 1.5 AS Bonus FROM employees
d. SELECT employee_id, salary, salary * 150% AS "Bonus" FROM employees
Question 17
Display the employee id, number of years and the hiring date of every employee in the company.
Select one:
a. SELECT employee_id, hire_date, ROUND((SYSDATE - hire_date),0 /365,0) FROM employees;
b. SELECT employee_id, hire_date, ROUND((SYSDATE - hire_date) /365,0) FROM employees;
c. SELECT employee_id, hire_date, hire_date /365 FROM employees;
d. SELECT employee_id, hire_date, hire_date- SYSDATE /365 FROM employees;
Question 18
You want to display all the job position titles whose salary is salary from 5,000 to 12,000 arrange from highest
to lowest
Select one:
a. SELECT job_title FROM jobs WHERE salary >= 5000 AND salary <= 10000
b. SELECT job_title FROM employees WHERE salary >= 5000 AND salary <= 10000
c. SELECT employees_id, job_title FROM employees WHERE salary >= 5000 AND salary <= 10000
d. SELECT job_title FROM jobs WHERE min_salary >= 5000 AND max_salary<= 10000
Question 19
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 >= 100000 AND salary <= 200000
ORDER BY salary
b. SELECT employee_id, salary FROM employees WHERE salary *12 >= 100000 AND salary *12 <=
200000 ORDER BY salary desc
c. SELECT employee_id, salary, salary *12 FROM employees WHERE 12* salary = 100000 AND 12
*salary = 200000 ORDER BY salary
d. SELECT employee_id, salary FROM employees WHERE salary *12 >= 100000 AND salary *12 <=
200000 ORDER BY salary
Question 20
You want to display the employee's id and formatted date hired as shown below.
Required output :
Select one:
a. SELECT employee_id, TO_DATE (hire_date, 'format Month DD, YYYY') AS "Hired Date" FROM
employees;
b. SELECT employee_id, TO_CHAR(hire_date, 'fmMonth DD, YYYY') AS "Hired Date" FROM
employees;
c. SELECT employee_id, format(TO_DATE(hire_date, 'Month DD, YYYY')) AS "Hired Date" FROM
employees;
d. SELECT employee_id, TO_CHAR(hire_date, 'Month DD, YYYY') AS "Hired Date" FROM employees;
Question 21
Question 22
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 * 1.1 FROM parts WHERE warehouse = 3
c. SELECT partnum, price, price * 10% FROM parts WHERE warehouse = 3
d. SELECT partnum, price, price * 1.10% FROM parts WHERE warehouse = 3
Question 23
Question 24
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
c. SELECT employee_id, first_name, last_name FROM employees WHERE job_id = 'IT_PROG' OR
first_name LIKE 'D%' and ORDER BY department_id
d. SELECT employee_id, first_name, last_name FROM employees ORDER BY department_id WHERE
first_name LIKE 'D%' and job_id = 'IT_PROG'
Question 25
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 first_name, last_name, salary FROM employees WHERE salary < 8000 AND department_id =
100 AND ORDER BY department_id
b. SELECT name, salary FROM employees WHERE department_id = 100 AND salary < 8000 ORDER
BY salary ASC
c. SELECT first_name, last_name, salary FROM employees WHERE department_id = 100 AND salary <
8000 ORDER BY salary
d. SELECT name 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 employees FROM first_name, last_name, salary WHERE department_id = 100 AND salary <
8000 ORDER BY salary ASC
Question 26
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:
a. SELECT CONCAT(CONCAT(employee_id, ':'), last_name) AS Employee FROM employees WHERE
salary >= 5000 AND salary <= 10000
b. SELECT CONCAT(employee_id, ':', last_name) AS Employee, salary FROM employees WHERE
salary BETWEEN 5000 TO 10000
c. SELECT CONCAT(employee_id,last_name) AS Employee FROM employees WHERE salary >5000
AND 10000
d. SELECT CONCAT(CONCAT(employee_id, ':'), last_name) AS Employee, salary FROM employees
WHERE salary >= 5000 AND salary <= 10000
Question 27
A Cartesian product is formed when:
Select one:
a. A join condition is omitted
b. All rows in the first table are joined to all rows in the second table
c. A join condition is invalid
d. All of the choices
Question 28
Question 29
John want to know how many employees receiving salary below 10,000.
Select one:
a. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
b. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
c. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
d. SELECT COUNT(*) FROM employees WHERE salary < 10000;
Question 30
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. OUTER JOIN
b. FULL OUTER JOIN
c. INNER JOIN
d. NATURAL JOIN
Question 31
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
WHERE class = 'AP'
GROUP BY warehouse, class
ORDER BY warehouse;
b. SELECT warehouse, class, MAX(price), MIN(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse, class
ORDER BY warehouse;
WHERE class = 'AP'
c. SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
FROM parts
GROUP BY warehouse
WHERE class = 'AP'
ORDER BY warehouse, class;
d. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
FROM parts
WHERE class = 'AP'
GROUP BY warehouse, class, price
ORDER BY warehouse, class
Question 32
Ronnie is the stockman in the warehouse of ATR Corporation. The General Manager wants to know the parts
whose price is above 10000 and above. Which of the following SQL command that Ronnie will run to generate
the list.
Select one:
a. SELECT ALL FROM parts WHERE price < 10000;
b. SELECT parts FROM price WHERE price >= 10000;
c. SELECT * FROM parts WHERE price > 10000;
d. SELECT ALL FROM parts WHERE price > ‘10000’;
e. SELECT * FROM parts WHERE price <= 10000;
f. SELECT * FROM parts WHERE price >= 10000;
Question 33
Display the employee's name, job title, job_id and the department name of employees with department id of
100.
Select one:
a. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J
NATURAL JOIN department D ON E.job_id = J.job_id
NATURAL JOIN employees E ON E.department_id = D.department_id
WHERE E.department_id = 100
b. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J
INNER JOIN department D ON E.job_id = J.job_id
INNER JOIN employees EON E.department_id = D.department_id
WHERE E.department_id = 100
c. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM employees E
JOIN jobs J ON E.job_id = J.job_id
JOIN departments D ON E.department_id = D.department_id
WHERE E.department_id = 100
d. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM employees E
JOIN department D ON E.job_id = J.job_id
JOIN jobs J ON E.department_id = D.department_id
WHERE E.department_id = 100
Question 34
Question 35
Display the lastname of every employee in the company. Display the output in a single column and label it as
Fullname
Format: JuanReyes
Select one:
a. None of the choices
b. SELECT CONCATENATE(first_name, last_name) AS Fullname FROM employees
c. SELECT CONCAT(first_name, last_name) AS Fullname FROM employees
d. SELECT CONCAT(first_name, last_name) FROM employees
Question 36
Display the first 5 letter in the surname of all the employees whose firstname starts with letter 'N'
Select one:
a. SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN
'N'
b. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) =
'N'
c. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN
'N'
d. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE first_name IN 'N'
e. SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE first_name = 'N'
Question 37
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:
a. CREATE matt ACCESS 1234
b. CREATE USER matt IDENTIFIED BY 1234
c. None of the choices
d. CREATE USERNAME matt PASSWORD 1234
e. CREATE USER FR0M DB_USER SET user
Question 38
Austin David was transferred to Purchasing Department. You are assigned to update the database.
Question 39
You want to display the employee id, date hired of all employees whose hired date is September.
Select one:
a. SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_DATE(hire_date, 'MON') = 'SEP'
b. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_CHAR(hire_date, 'MON') = 'SEP'
c. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_CHAR(hire_date, 'Month') = TO_DATE('September')
d. SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees
WHERE TO_DATE(hire_date, 'Month') = TO_DATE(‘09’)
Question 40
You want to display the employee's last name hired from year 2000 to 2002.
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-Jan-2000', 'DD-
Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-YYYY')
b. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('2000', 'YYYY')
AND hire_date<= TO_DATE('2002', 'YYYY')
c. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-Jan-2000', 'DD-
Mon-RR') AND hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-RR')
d. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('Jan-2000', 'Month-
YYYY') AND hire_date<= TO_DATE('Dec-2002', 'Month-‘YYYY')
Question 41
Question 42
Question 43
Question 44
You want to display the employee's last name and date hired in year 2000 to2006 whose salary is above 5000.
Which SQL statement give the required output?
Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('Jan-2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') AND
salary > 5,000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR') AND
salary > 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-
YYYY') AND salary ABOVE 5000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2006', 'YYYY') OR salary > 5000;
Question 45
Display all the records in the employee table. Arrange the output in by lastname from A-Z order.
Select one:
a. SELECT * FROM employees SORT BY lastname ascending
b. SELECT * FROM employees ORDER BY lastname AZ
c. SELECT * FROM employees ORDER BY lastname
d. SELECT * FROM employees SORT BY lastname
Question 46
You want to generate the total salary per month of every department in the company.
Select one:
a. SELECT department_id, SUM(salary) FROM employees GROUP BY department_id
b. SELECT department_id, TOTAL(salary) FROM employees GROUP BY department_id
c. SELECT department_id, salary FROM employees GROUP BY SUM(salary) ORDER BY department_id
d. SELECT department_id, salary FROM employees ORDER BY SUM(salary)
Question 47
Which of the following SELECT statement is the correct PL/SQL that willcreate a report specifying only the
column PRICE, ONHAND and DESCRIPTION?
Select one:
a. SELECTONHAND,PRICE DESCRIPTION FROM PARTS ORDER BY ONHAND;
b. SELECT (ONHAND||PRICE ||DESCRIPTION FROM PARTS;
c. SELECTONHAND,PRICE ,DESCRIPTION FROM PARTS;
d. SELECT PRICE, ONHAND, DESCRIPTION FROM PARTS;
Question 48
TRUE OR FALSE.
The INSERT statement can add multiple rows.
Select one:
True
False
Question 49
Which of the following SELECT statement is the correct report that will rename the column DESCRIPTION to
TITLE, PARTNUM to ID and ONHAND to STOCK?
Select one:
a. SELECT DESCRIPTION NEW AS TITLE, PARTNUM NEW AS ID, ONHAND NEW AS STOCK
FROM PARTS;
b. SELECT DESCRIPTION AS TITLE, PARTNUM AS ID, ONHAND AS STOCK FROM PART;
c. SELECT DESCRIPTION RENAME AS TITLE, PARTNUM RENAME AS ID, ONHAND RENAME
AS STOCK FROM PARTS;
d. SELECT DESCRIPTION AS 'TITLE', PARTNUM AS 'ID', ONHAND AS 'STOCK' FROM PARTS;
Question 50
State Finished
Question 1
Question 2
Select one:
Question 3
1 DECLARE
3 BEGIN
5 END;
Select one:
Question 4
You want to display all employee id, name, hired date and salary who are hired after employee 104 was hired.
Select one:
d. SELECT employee_id, last_name, hire_date, salary FROM employees WHERE TO_NUMBER((hire_date, 'YYYY') IN
(SELECT TO_NUMBER(hire_date, 'YYYY') FROM employees WHERE
employee_id = 104)
Question 5
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?
Select one:
a. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET salary = v_salary * 2 WHERE job_id = v_job_id;
END;
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 2 WHERE job_id = v_job_id;
END;
c. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET v_salary = salary * 2 WHERE v_job_id = job_id;
END;
Question 6
Actions are being performed when error occurs during PL/SQL execution in the
Select one:
a. ERROR HANDLING
b. BEGIN section
c. FUNCTION
d. EXCEPTION
Question 7
Which of the folllowing is required in a subquery?
Select one:
a. HAVING BY
b. SELECT
c. GROUP BY
d. ORDER BY
Question 8
Select one:
Question 9
You want to display all the records of employee the same with the salary employee number 103.
Select one:
a. SELECT * FROM employees WHERE salary = (SELECT salary from employees where employee_id= 103)
b. SELECT salary FROM employees WHERE salary = (SELECT * from employees where employee_id= 103)
d. SELECT * FROM employees WHERE employee_id = 103 AND salary = (SELECT salary from employees)
Question 10
Select one:
Question 1
Evaluate the following PL/SQL. Which of the following will line creates an error?
Select one:
a. Line 5
b. Line 9
c. Line 11
d. No error
e. Line 3
f. Line 1
Question 2
These are local variables declared in the parameter list of a subprogram specification.
Select one:
a. Actual arguments
b. Passing parameter
c. Formal parameter
d. Actual parameter
Question 3
Question 4
Question 5
Question 6
Which of the folllowing does NOT describes subprogram? i. Compiled only once ii. Stored in the database iii.
Do not return values iv. Can take parameters v. Unnamed PL/SQL blocks
Select one:
a. iii & iv
b. ii & v
c. i & iii
d. iii & v
Question 7
Which of the following command is used to create a stand-alone procedure that is stored in the Oracle database?
Select one:
a. DO PROCEDURE
b. CREATE
c. CREATE PROCEDURE
d. PROCEDURE
e. BUILD PROCEDURE
Question 8
Evaluate the following PL/SQL.
Select one:
a. The stored procedure will create an error in line 7
b. The stored procedure will create an error in line 5
c. No error
d. The stored procedure will create an error in line 2 to 4.
Question 9
Question 10
Question 1
What is the exception name when single row SELECT returned no data.
Select one:
a. NO_RECORDS_FOUND
b. NO_DATA_FOUND
c. END_OF_DATA
d. ZERO_RECORDS_FOUND
Question 2
Question 3
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 4
Question 5
Question 6
Question 7
What is the error trapping function that returns the numeric value of the error code?
Select one:
a. ERROR_CODE
b. SQL_ERRORCODE
c. ERRORCODE
d. SQLCODE
Question 8
Question 9
Question 10
Question 11
Question 12
Question 13
You can use this procedure to issue user-defined error messages from stored subprograms.
Select one:
a. USER_DEFINED_PROC
b. CALL_FUNCTION
c. SUB_ROUTINE
d. RAISE_APPLICATION_ERROR
e. PROCEDURE
Question 14
Question 15
Question 16
Question text
Question 17
You can use this procedure to issue user-defined error messages from stored subprograms.
Select one:
a. CALL_FUNCTION
b. USER_DEFINED_PROC
c. SUB_ROUTINE
d. PROCEDURE
e. RAISE_APPLICATION_ERROR
Question 18
1. DECLARE
2. v_employee_id employees.employee_id%TYPE := 114;
3. BEGIN
4. DELETE employees WHERE employee_id = v_employee_id;
5. END;
Select one:
a. The PL/SQL will produce an error in line 4.
b. The PL/SQL will produce an error in line 2.
c. The PL/SQL will delete employee number 114.
d. To execute successfully delete line 1,2,3,5.
Question 19
Question 20
You can trap any error by including a corresponding handler within the exception-handling section of the
PL/SQL block.
Select one:
True
False
Question 1
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Subtype
b. Index
c. Data
d. Schema
e. Data dictionary
Question 2
Question 3
Restrictive, specifies a RETURN type, associates only with type-compatible queries are description of a
________________.
Select one:
a. Procedural REF CURSOR
b. Weak REF CURSOR
c. Functional REF CURSOR
d. Strong REF CURSOR
e. Relational REF CURSOR
Question 4
Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Select one:
True
False
Question 5
Fetch into a record when fetching from a cursor.
Select one:
True
False
Question 6
Question 7
Which of the following is INCORRECT about the guidelines for cursor design?
Select one:
a. Use column aliases in cursors for calculated columns fetched into records declared with
%COLUMNTYPE.
b. None of the choices.
c. Simplify coding with cursor FOR loops.
d. Close a cursor when it is no longer needed.
Question 8
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Data dictionary
b. Index
c. Subtype
d. Schema
e. Data
Question 9
Question 10
Which of the following is the syntax to close a cursor?
Select one:
a. CLOSE cursor_variable_name;
b. EXIT cursor_variable_name;
c. QUIT cursor_variable_name;
d. SET cursor_variable_nameCLOSE;
Question 11
Question 12
Question 13
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. 8.5
b. 18
c. None of the choices
d. -1
Question 14
Question 15
State Finished
Question 1
Which of the following is INCORRECT about the guidelines for cursor design?
Select one:
b. Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Question 2
Select one:
a. CONFIRM
b. OTHERWISE
c. THEN
d. WHEN OTHERS
Question 3
1. DECLARE
2. v_employee_id employees.employee_id%TYPE := 114;
3. BEGIN
4. DELETE employees WHERE employee_id = v_employee_id;
5. END;
Select one:
Question 4
Select one:
Question 5
Restrictive, specifies a RETURN type, associates only with type-compatible queries are description of a
________________.
Select one:
Question 6
Select one:
a. You cannot use cursor variables with remote subprograms on another server.
d. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
Question 7
Select one:
a. Procedures
b. Database triggers
c. Functions
d. Packages
f. Anonymous blocks
Question 8
Select one:
True
False
Question 9
Matt wants to change his password from 1234 to abcd.
Which of the following will perform the task?
Select one:
d. User matt cannot change his password. DBA has only the rights to change the password
Question 10
Select one:
a. THEN
b. CONFIRM
c. OTHERWISE
d. WHEN OTHERS
Question 11
Select one:
Question 12
Select one:
Question 13
Select one:
a. You cannot use cursor variables with remote subprograms on another server.
c. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
Question 14
Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Select one:
True
False
Question 15
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.
Select one:
a. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary *0.50 WHERE job_id = v_job_id;
END;
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 50% WHERE job_id = v_job_id;
END;
c. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET salary = v_salary * 0.50% WHERE job_id = v_job_id;
END;
d. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET v_salary = salary * 0.50 WHERE v_job_id = job_id;
END;
Question 16
Select one:
c. Improved performance
d. Easy maintenance
Question 17
You have been tasked to update the database by creating a PL/SQL to increase the salary of all IT Programmer
employees by 100% of their existing salary. Which of the following will execute successfully?
Select one:
a. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 2 WHERE job_id = v_job_id;
END;
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 100% WHERE job_id = v_job_id;
END;
c. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET v_salary = salary * 1.00 WHERE v_job_id = job_id;
END;
d. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET salary = v_salary * 0.100% WHERE job_id = v_job_id;
END;
Question 18
Which of the following will erase all records in the departments table
Select one:
Question 19
Select one:
b. All rows in the first table are joined to all rows in the second table
Question 20
You want to display all employee id, name, hired date and salary who are hired after employee 104 was hired.
Select one:
b. SELECT employee_id, last_name, hire_date, salary FROM employees WHERE TO_NUMBER((hire_date, 'YYYY') IN
(SELECT TO_NUMBER(hire_date, 'YYYY') FROM employees WHERE
employee_id = 104)
d. SELECT employee_id, last_name, hire_date, salary FROM employees WHERE TO_CHAR(hire_date, 'YYYY') ANY
(SELECT TO_CHAR(hire_date, 'YYYY') FROM employees WHERE employee_id = 104)
Question 21
Which of the following PL/SQL that will display the total number employees whose salary is 10000 and above?
Select one:
a. 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;
c. DECLARE
v_salary employees.salary%TYPE :>= 10000;
BEGIN
SELECT COUNT(salary) INTO v_salary FROM employees WHERE salary >= v_salary;
DBMS_OUTPUT.PUT_LINE(‘Total:’ || v_salary);
END;
d. DECLARE
v_salary TYPE%NUMERIC >= 10000;
BEGIN
SELECT COUNT(salary) INTO v_salary FROM employees WHERE salary >= v_salary;
DBMS_OUTPUT.PUT_LINE(‘Total:’ || v_salary);
END;
Question 22
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:
Question 23
Select one:
True
False
Question 24
In PL/SQL Block Structure, which of the following are OPTIONAL?
Select one:
Question 25
Which of the following DOES NOT describes the state of the data after the COMMIT command
Select one:
d. Locks on the affected rows are released; those rows are available for other users to manipulate.
Question 26
1. DECLARE
5. BEGIN
6. INSERT INTO employees (employee_id, last_name, first_name, email, hire_date, job_id, salary)
8. END;
Select one:
a. Error in Line 7. Due to invalid variables.
b. No Error.
Question 27
Select one:
a. Code
b. Information
c. Data
d. Table
Question 28
Select one:
b. The SQL command should have ALIAS for the table to produce a correct output.
Question 29
These are local variables declared in the parameter list of a subprogram specification.
Select one:
a. Actual arguments
b. Formal parameter
c. Actual parameter
d. Passing parameter
Question 30
Select one:
Question 31
Select one:
a. EXECUTION_ERROR
b. ERROR_MSG
c. RUNTIME_ERROR
d. PROGRAM_ERROR
Question 32
Select one:
a. IN OUT
b. OUT
c. IN
d. DEFAULT
Question 33
Which of the following command is used to create a stand-alone procedure that is stored in the Oracle database?
Select one:
a. PROCEDURE
b. DO PROCEDURE
c. CREATE PROCEDURE
d. CREATE
e. BUILD PROCEDURE
Question 34
You can use this procedure to issue user-defined error messages from stored subprograms.
Select one:
a. SUB_ROUTINE
b. CALL_FUNCTION
c. USER_DEFINED_PROC
d. RAISE_APPLICATION_ERROR
e. PROCEDURE
Question 35
Select one:
a. Implicitly
b. Interactively
c. Exclusively
d. Explicitly
Question 36
Evaluate the following PL/SQL. Which of the following will line creates an error?
Select one:
a. Line 5
b. Line 9
c. No error
d. Line 3
e. Line 1
f. Line 11
Question 37
Select one:
a. POINTER
b. SAVEMARKER
c. INDEX
d. SAVEPOINT
e. SAVEMORE
Question 38
Select one:
True
False
Question 39
Select one:
b. No error
c. The stored procedure will create an error in line 2 to 4.
Question 40
Select one:
a. OPEN cursor_variable_name
FOR select_statement;
b. GET cursor_variable_name
FOR select_statement;
c. SET cursor_variable_name
FOR select_statement;
d. LOAD cursor_variable_name
FOR select_statement;
Question 41
Which of the folllowing does NOT describes subprogram? i. Compiled only once ii. Stored in the database iii. Do not
return values iv. Can take parameters v. Unnamed PL/SQL blocks
Select one:
a. iii & v
b. i & iii
c. ii & v
d. iii & iv
Question 42
You want to cancel the privilege of matt to add records from the employees table.
Select one:
Question 43
Select one:
a. Correct syntax.
Question 44
Select one:
c. This will return an error. Employees table can not be used in the subquery if it used in the main query.
Question 45
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Subtype
b. Data dictionary
c. Schema
d. Index
e. Data
Question 46
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. Subtype
d. Data
e. Index
Question 47
Select one:
a. Information
b. Data
c. Code
d. Table
Question 48
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Select one:
Question 49
Select one:
Select one:
State Finished
Question 1
Select one:
Question 2
Select one:
Question 3
1 DECLARE
3 BEGIN
5 END;
Select one:
a. The PL/SQL will delete employee number 114.
Question 4
You want to display all employee id, name, hired date and salary who are hired after employee 104 was hired.
Select one:
Question 5
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?
Select one:
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 2 WHERE job_id = v_job_id;
END;
Question 6
Actions are being performed when error occurs during PL/SQL execution in the
Select one:
d. EXCEPTION
Question 7
Select one:
b. SELECT
Question 8
Select one:
Question 9
You want to display all the records of employee the same with the salary employee number 103.
Select one:
a. SELECT * FROM employees WHERE salary = (SELECT salary from employees where employee_id= 103)
Question 10
Which of the following is INCORRECT?
Select one:
State Finished
Question 1
Evaluate the following PL/SQL. Which of the following will line creates an error?
Select one:
a. Line 5
b. Line 9
c. Line 11
d. No error
e. Line 3
f. Line 1
Question 2
These are local variables declared in the parameter list of a subprogram specification.
Select one:
a. Actual arguments
b. Passing parameter
c. Formal parameter
d. Actual parameter
Question 3
Select one:
a. IN
b. DEFAULT
c. OUT
d. IN OUT
Question 4
Select one:
True
False
Question 5
Select one:
Which of the folllowing does NOT describes subprogram? i. Compiled only once ii. Stored in the database iii. Do not
return values iv. Can take parameters v. Unnamed PL/SQL blocks
Select one:
a. iii & iv
b. ii & v
c. i & iii
d. iii & v
Question 7
Which of the following command is used to create a stand-alone procedure that is stored in the Oracle database?
Select one:
a. DO PROCEDURE
b. CREATE
c. CREATE PROCEDURE
d. PROCEDURE
e. BUILD PROCEDURE
Question 8
Select one:
c. No error
Question 9
Which if the following is NOT a benefits of using modular program constructs?
Select one:
a. Improved performance
c. Easy maintenance
Question 10
Select one:
a. Functions
b. Packages
c. Anonymous blocks
e. Database triggers
f. Procedures
State Finished
Question 1
What is the exception name when single row SELECT returned no data.
Select one:
a. NO_RECORDS_FOUND
b. NO_DATA_FOUND
c. END_OF_DATA
d. ZERO_RECORDS_FOUND
Question 2
Select one:
Question 3
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 4
Select one:
Question 5
Select one:
Question 6
Select one:
Question 7
What is the error trapping function that returns the numeric value of the error code?
Select one:
a. ERROR_CODE
b. SQL_ERRORCODE
c. ERRORCODE
d. SQLCODE
Question 8
Select one:
Question 9
Select one:
Question 10
Select one:
Question 11
Select one:
a. Explicitly
b. Exclusively
d. Interactively
e. Implicitly
Question 12
Select one:
You can use this procedure to issue user-defined error messages from stored subprograms.
Select one:
a. USER_DEFINED_PROC
b. CALL_FUNCTION
c. SUB_ROUTINE
d. RAISE_APPLICATION_ERROR
e. PROCEDURE
Question 14
Select one:
b. e_invalid_id AS EXCEPTION;
c. EXCEPTION e_invalid_id;
d. e_invalid_id EXCEPTION;
Question 15
Select one:
a. Explicitly
b. Interactively
d. Exclusively
e. Implicitly
Question 16
Select one:
Question 17
You can use this procedure to issue user-defined error messages from stored subprograms.
Select one:
a. CALL_FUNCTION
b. USER_DEFINED_PROC
c. SUB_ROUTINE
d. PROCEDURE
e. RAISE_APPLICATION_ERROR
Question 18
1. DECLARE
2. v_employee_id employees.employee_id%TYPE := 114;
3. BEGIN
4. DELETE employees WHERE employee_id = v_employee_id;
5. END;
Select one:
Question 19
Select one:
a. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT * INTO v_salary FROM employees;
END;
b. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT salary INTO v_salary FROM employees WHERE employee_id = 150;
END;
c. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT salary FROM employees WHERE employee_id = 150;
DBMS_OUTPUT(v_salary);
END;
d. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT salary FROM employees WHERE employee_id = 150;
DBMS_OUTPUT.SCREEN(v_salary);
END;
Question 20
You can trap any error by including a corresponding handler within the exception-handling section of the PL/SQL block.
Select one:
True
False
State Finished
Question 1
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Subtype
b. Index
c. Data
d. Schema
e. Data dictionary
Question 2
Select one:
e. You cannot use cursor variables with remote subprograms on another server.
f. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
Question 3
Restrictive, specifies a RETURN type, associates only with type-compatible queries are description of a
________________.
Select one:
Question 4
Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Select one:
True
False
Question 5
Select one:
True
False
Question 6
Select one:
Question 7
Which of the following is INCORRECT about the guidelines for cursor design?
Select one:
a. Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Question 8
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Data dictionary
b. Index
c. Subtype
d. Schema
e. Data
Question 9
Select one:
a. None of the choices.
c. You cannot use cursor variables with remote subprograms on another server.
e. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
Question 10
Select one:
a. CLOSE cursor_variable_name;
b. EXIT cursor_variable_name;
c. QUIT cursor_variable_name;
d. SET cursor_variable_nameCLOSE;
Question 11
Select one:
a. LOAD cursor_variable_name
FOR select_statement;
b. GET cursor_variable_name
FOR select_statement;
c. SET cursor_variable_name
FOR select_statement;
d. OPEN cursor_variable_name
FOR select_statement;
Question 12
Select one:
True
False
Question 13
Evaluate the following. What will be the output?
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. 8.5
b. 18
d. -1
Question 14
Select one:
b. Restrictive
d. Is not flexible
Question 15
Select one:
State Finished
Question 1
Which of the following is INCORRECT about the guidelines for cursor design?
Select one:
b. Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Question 2
Select one:
a. CONFIRM
b. OTHERWISE
c. THEN
d. WHEN OTHERS
Question 3
1. DECLARE
2. v_employee_id employees.employee_id%TYPE := 114;
3. BEGIN
4. DELETE employees WHERE employee_id = v_employee_id;
5. END;
Select one:
Question 4
Select one:
Question 5
Restrictive, specifies a RETURN type, associates only with type-compatible queries are description of a
________________.
Select one:
Question 6
Select one:
a. You cannot use cursor variables with remote subprograms on another server.
d. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
Question 7
Select one:
a. Procedures
b. Database triggers
c. Functions
d. Packages
f. Anonymous blocks
Question 8
Select one:
True
False
Question 9
Select one:
d. User matt cannot change his password. DBA has only the rights to change the password
Question 10
What is the last clause in trapping exceptions?
Select one:
a. THEN
b. CONFIRM
c. OTHERWISE
d. WHEN OTHERS
Question 11
Select one:
Question 12
Select one:
Question 13
Select one:
a. You cannot use cursor variables with remote subprograms on another server.
c. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
Question 14
Use column aliases in cursors for calculated columns fetched into records declared with %COLUMNTYPE.
Select one:
True
False
Question 15
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.
Select one:
a. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary *0.50 WHERE job_id = v_job_id;
END;
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 50% WHERE job_id = v_job_id;
END;
c. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET salary = v_salary * 0.50% WHERE job_id = v_job_id;
END;
d. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET v_salary = salary * 0.50 WHERE v_job_id = job_id;
END;
Question 16
Select one:
d. Easy maintenance
Question 17
You have been tasked to update the database by creating a PL/SQL to increase the salary of all IT Programmer
employees by 100% of their existing salary. Which of the following will execute successfully?
Select one:
a. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 2 WHERE job_id = v_job_id;
END;
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 100% WHERE job_id = v_job_id;
END;
c. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET v_salary = salary * 1.00 WHERE v_job_id = job_id;
END;
d. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET salary = v_salary * 0.100% WHERE job_id = v_job_id;
END;
Question 18
Which of the following will erase all records in the departments table
Select one:
Question 19
A Cartesian product is formed when:
Select one:
b. All rows in the first table are joined to all rows in the second table
Question 20
You want to display all employee id, name, hired date and salary who are hired after employee 104 was hired.
Select one:
b. SELECT employee_id, last_name, hire_date, salary FROM employees WHERE TO_NUMBER((hire_date, 'YYYY') IN
(SELECT TO_NUMBER(hire_date, 'YYYY') FROM employees WHERE
employee_id = 104)
d. SELECT employee_id, last_name, hire_date, salary FROM employees WHERE TO_CHAR(hire_date, 'YYYY') ANY
(SELECT TO_CHAR(hire_date, 'YYYY') FROM employees WHERE employee_id = 104)
Question 21
Which of the following PL/SQL that will display the total number employees whose salary is 10000 and above?
Select one:
a. 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;
c. DECLARE
v_salary employees.salary%TYPE :>= 10000;
BEGIN
SELECT COUNT(salary) INTO v_salary FROM employees WHERE salary >= v_salary;
DBMS_OUTPUT.PUT_LINE(‘Total:’ || v_salary);
END;
d. DECLARE
v_salary TYPE%NUMERIC >= 10000;
BEGIN
SELECT COUNT(salary) INTO v_salary FROM employees WHERE salary >= v_salary;
DBMS_OUTPUT.PUT_LINE(‘Total:’ || v_salary);
END;
Question 22
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:
Question 23
Select one:
True
False
Question 24
Select one:
Question 25
Which of the following DOES NOT describes the state of the data after the COMMIT command
Select one:
d. Locks on the affected rows are released; those rows are available for other users to manipulate.
Question 26
1. DECLARE
5. BEGIN
6. INSERT INTO employees (employee_id, last_name, first_name, email, hire_date, job_id, salary)
8. END;
Select one:
b. No Error.
Question 27
Select one:
a. Code
b. Information
c. Data
d. Table
Question 28
Select one:
b. The SQL command should have ALIAS for the table to produce a correct output.
Question 29
These are local variables declared in the parameter list of a subprogram specification.
Select one:
a. Actual arguments
b. Formal parameter
c. Actual parameter
d. Passing parameter
Question 30
Select one:
Question 31
Select one:
a. EXECUTION_ERROR
b. ERROR_MSG
c. RUNTIME_ERROR
d. PROGRAM_ERROR
Question 32
Select one:
a. IN OUT
b. OUT
c. IN
d. DEFAULT
Question 33
Which of the following command is used to create a stand-alone procedure that is stored in the Oracle database?
Select one:
a. PROCEDURE
b. DO PROCEDURE
c. CREATE PROCEDURE
d. CREATE
e. BUILD PROCEDURE
Question 34
You can use this procedure to issue user-defined error messages from stored subprograms.
Select one:
a. SUB_ROUTINE
b. CALL_FUNCTION
c. USER_DEFINED_PROC
d. RAISE_APPLICATION_ERROR
e. PROCEDURE
Question 35
Select one:
a. Implicitly
b. Interactively
c. Exclusively
d. Explicitly
Question 36
Evaluate the following PL/SQL. Which of the following will line creates an error?
Select one:
a. Line 5
b. Line 9
c. No error
d. Line 3
e. Line 1
f. Line 11
Question 37
Select one:
a. POINTER
b. SAVEMARKER
c. INDEX
d. SAVEPOINT
e. SAVEMORE
Question 38
Select one:
True
False
Question 39
Select one:
b. No error
Question 40
Select one:
a. OPEN cursor_variable_name
FOR select_statement;
b. GET cursor_variable_name
FOR select_statement;
c. SET cursor_variable_name
FOR select_statement;
d. LOAD cursor_variable_name
FOR select_statement;
Question 41
Which of the folllowing does NOT describes subprogram? i. Compiled only once ii. Stored in the database iii. Do not
return values iv. Can take parameters v. Unnamed PL/SQL blocks
Select one:
a. iii & v
b. i & iii
c. ii & v
d. iii & iv
Question 42
You want to cancel the privilege of matt to add records from the employees table.
Select one:
Question 43
Select one:
a. Correct syntax.
Question 44
Select one:
a. This will return an error. "ANY" can not be compared to salary
c. This will return an error. Employees table can not be used in the subquery if it used in the main query.
Question 45
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Subtype
b. Data dictionary
c. Schema
d. Index
e. Data
Question 46
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. Subtype
d. Data
e. Index
Question 47
Select one:
a. Information
b. Data
c. Code
d. Table
Question 48
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Select one:
Question 49
Select one:
Question 50
Select one:
State Finished
Question 1
Evaluate the following PL/SQL. Which of the following will line creates an error?
Select one:
a. Line 5
b. Line 3
c. Line 1
d. No error
e. Line 11
f. Line 9
Question 2
You want to know the total number of employees whose firstname starts with letter D.
Select one:
a. DECLARE
v_first_name employees.first_name%TYPE := 'D%';
BEGIN
SELECT COUNT(*) INTO v_first_name FROM employees WHERE first_name LIKE v_first_name;
DBMS_OUTPUT.PUT_LINE(v_first_name);
END;
c. DECLARE
v_first_name VARCHAR(20) = ‘D%’;
BEGIN
SELECT COUNT(*) INTO v_first_name FROM employees WHERE first_name LIKE v_first_name;
DBMS_OUTPUT.PUT_LINE(v_first_name);
END;
d. DECLARE
v_first_name employees.first_name%TYPE LIKE 'D%';
BEGIN
SELECT COUNT(*) INTO v_first_name FROM employees WHERE first_name = v_first_name;
DBMS_OUTPUT.PUT_LINE(v_first_name);
END;
Question 3
Actions are being performed when error occurs during PL/SQL execution in the
Select one:
a. BEGIN section
b. ERROR HANDLING
c. EXCEPTION
d. FUNCTION
Question 4
Select one:
a. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT salary FROM employees WHERE employee_id = 150;
DBMS_OUTPUT(v_salary);
END;
b. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT salary INTO v_salary FROM employees WHERE employee_id = 150;
END;
c. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT salary FROM employees WHERE employee_id = 150;
DBMS_OUTPUT.SCREEN(v_salary);
END;
d. DECLARE
v_salary INTEGER(20);
BEGIN
SELECT * INTO v_salary FROM employees;
END;
Question 5
Select one:
True
False
Question 6
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
Question 7
Select one:
Question 8
Select one:
b. Implicitly
c. Explicitly
d. Exclusively
e. Interactively
Question 9
Which of the following is the syntax to open a cursor varial
Select one:
a. OPEN cursor_variable_name
FOR select_statement;
b. GET cursor_variable_name
FOR select_statement;
c. LOAD cursor_variable_name
FOR select_statement;
d. SET cursor_variable_name
FOR select_statement;
Question 10
These are local variables declared in the parameter list of a subprogram specification.
Select one:
a. Passing parameter
b. Formal parameter
c. Actual arguments
d. Actual parameter
Question 11
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?
Select one:
b. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET v_salary = salary * 2 WHERE v_job_id = job_id;
END;
c. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 2 WHERE job_id = v_job_id;
END;
d. DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
v_salary employees.salary := salary;
BEGIN
UPDATE employees SET salary = v_salary * 2 WHERE job_id = v_job_id;
END;
Question 12
Select one:
Question 13
Which of the following command will delete all records in the table employees
Select one:
Question 14
Select one:
Question 15
Which of the following command is used to create a stand-alone procedure that is stored in the Oracle database?
Select one:
a. CREATE PROCEDURE
b. PROCEDURE
c. BUILD PROCEDURE
d. CREATE
e. DO PROCEDURE
Question 16
Select one:
c. This will return an error. Department Id should be included in the list of field in the main query.
d. This will return an error. Single-row subquery returns more than one row.
Question 17
TRUE OR FALSE.
The INSERT statement can add multiple rows.
Select one:
True
False
Question 18
Select one:
a. Removing users
b. Removing tables
d. Backing up tables
Question 19
Which of the following syntax to declare EXCEPTION named e_invalid_id?
Select one:
c. e_invalid_id AS EXCEPTION;
d. e_invalid_id EXCEPTION;
e. EXCEPTION e_invalid_id;
Question 20
Select one:
Question 21
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Subtype
b. Data dictionary
c. Schema
d. Index
e. Data
Question 22
Select one:
a. HAVING BY
b. ORDER BY
c. GROUP BY
d. SELECT
Question 23
Select one:
b. Functions
c. Anonymous blocks
d. Database triggers
e. Packages
f. Procedures
Question 24
Select one:
Question 25
Select one:
a. Implicitly
b. Explicitly
c. Exclusively
d. Interactively
Question 26
Question 27
Select one:
a. CLOSE cursor_variable_name;
b. SET cursor_variable_nameCLOSE;
c. QUIT cursor_variable_name;
d. EXIT cursor_variable_name;
Question 28
Select one:
True
False
Question 29
Select one:
True
False
Question 30
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:
b. -1
c. 8.5
d. 18
Question 31
This is a subset of an existing data type that may place a constraint on its base type.
Select one:
a. Subtype
b. Index
c. Data
d. Data dictionary
e. Schema
Question 32
This is a type of cursor which is created and managed internally by the Oracle server to process SQL statements
Select one:
a. Interactive
b. Explicit
c. Implicit
d. Exclusive
e. Coded
Question 33
Which of the following is the syntax to fetch from a cursor variable?
Select one:
Question 34
Select one:
a. 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.
c. The statement is incorrect. Only users of the database can be created by the Database Administrator.
Question 35
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 36
You can trap any error by including a corresponding handler within the exception-handling section of the PL/SQL block.
Select one:
True
False
Question 37
Select one:
b. You cannot use REF CURSOR types in CREATE TABLE or VIEW statements.
f. You cannot use cursor variables with remote subprograms on another server.
Question 38
Select one:
a. OUT
b. IN
c. DEFAULT
d. IN OUT
Question 39
Select one:
a. No error
Question 40
Select one:
c. Is not flexible
d. Restrictive
Question 41
Select one:
Question 42
Select one:
c. Easy maintenance
e. Improved performance
Question 43
TRUE OR FALSE.
Multiple fields in NOT allowed in a Foreign key.
Select one:
True
False
Question 44
Select one:
b. e_invalid_id AS EXCEPTION;
c. EXCEPTION e_invalid_id;
e. e_invalid_id EXCEPTION;
Question 45
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. NATURAL JOIN
c. OUTER JOIN
d. INNER JOIN
Question 46
Select one:
b. DDL
c. DCL
d. DML
Question 47
Which of the folllowing does NOT describes subprogram? i. Compiled only once ii. Stored in the database iii. Do not
return values iv. Can take parameters v. Unnamed PL/SQL blocks
Select one:
a. ii & v
b. i & iii
c. iii & v
d. iii & iv
Question 48
What is the exception name when single row SELECT returned no data.
Select one:
a. NO_DATA_FOUND
b. END_OF_DATA
c. ZERO_RECORDS_FOUND
d. NO_RECORDS_FOUND
Question 49
Select one:
Question 50
Select one:
a. Exclusively
c. Explicitly
d. Interactively
e. Implicitly