0% found this document useful (0 votes)
52 views

Database by Kuya NR Newdocx

Uploaded by

tejadajohndare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Database by Kuya NR Newdocx

Uploaded by

tejadajohndare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 85

Flag question

Question text
In creating Joins,the NATURALJOIN and USING clauses
are
Select one:
Mutually Inclusive
Limited to 2 relational tables
Opposite
Mutually Exclusive

D.department_name = 'Finance' ORDER BY "ANNUAL SALARY" DESC


c. SELECT E.employee_id, E.last_name, E.first_name, D.department_name, E.salary*12 AS "ANNUAL SALARY", D.location_i
FROM employees E
JOIN jobs J ON E.job_id = J.job_id
JOIN departments D ON E.department_id = D.department_id
WHERE D.location_id = 1700 AND D.department_name = 'Finance' ORDER BY "ANNUAL SALARY" DESC
d. SELECT E.employee_id, E.last_name, E.first_name, D.department_name, E.salary*12 AS "ANNUAL SALARY", D.location_
FROM employees E
OUTER JOIN jobs J ON E.job_id = J.job_id
OUTER JOIN departments D ON E.department_id = D.department_id
WHERE D.location_id = 1700 AND D.department_name = 'Finance' ORDER BY "ANNUAL SALARY" DESC

Question 24
Complete
Mark 4.00 out of 4.00

Flag question
PROG-113A-LAB-1812S / (47/50)► Week
Question text 10: Quarterly Examination / ► First Quarter
Display employee id, lastname, firstname, department name, annual salary, location id of employees whose location id is 1700 an
Sort the output in from highest to lowest salary. (4 POINTS)
Exam
Select one:
Question 1
SELECT E.employee_id, E.last_name, E.first_name, D.department_name, E.salary*12 AS "ANNUAL SALARY", D.location_id
Answer saved Marked out of 1.00
FROM employees E
NATURAL JOIN jobs J ON E.job_id = J.job_id NATURAL JOIN departments D ON E.department_id
= D.department_id
ORDER BY "ANNUAL SALARY" DESC
WHERE D.location_id = 1700 AND D.department_name = 'Finance'
SELECT E.employee_id, E.last_name, E.first_name, D.department_name, E.salary*12 AS "ANNUAL SALARY", D.location_id
FROM employees E Remove flag
JOIN jobs J ON E.job_id = J.job_id JOINemployees E ON E.department_id = D.department_id
WHERE D.location_id = 1700 AND Question text
You can relate data to multiple tables using a foreign key.
Remove flag Flag question

Question text Question text


Which of the following SELECT statement is the
correct report that will deduct 5 from ONHAND, What will be the SQL command if every employee will
multiply 5 in WAREHOUSE, after getting the value on be given a productivity bonus which is equivalent to
both ONHAND and WAREHOUSE add their data: as 3% of the monthly salary?
shown below: ONHAND - 5 + 5 * WAREHOUSE Display the employee id, salary and the productivity
Note that you have to force the Oracle to prioritize bonus.
first the Subtraction over Multiplication. List only the Select one:
column DESCRIPTION, ONHAND and
WAREHOUSE. a. SELECT employee_id, salary, salary * .03
FROM employees
Select one:
b. SELECT employee_id, salary, salary * .30
a. SELECT (ONHAND-5) + 5(* WAREHOUSE), FROM employees
DESCRIPTION FROM PARTS;
c. SELECT employee_id, salary, salary * 1.03
b. SELECT ONHAND-5 + 5 * WAREHOUSE, FROM employees
DESCRIPTION FROM PARTS;
d. SELECT employee_id, salary, salary + (salary
c. SELECT (ONHAND-5) + 5 * WAREHOUSE, .03) FROM employees
DESCRIPTION FROM PARTS;
e. SELECT employee_id, salary FROM
d. SELECT ONHAND-5 + 5 (* WAREHOUSE), employees WHERE salary)
DESCRIPTION FROM PARTS;
Question 5
Question 3 Answer saved
Answer saved Marked out of 1.00
Marked out of 1.00

Flag question
Flag question Question text
Question text
You want to display the employee’s last name
INSERT, DELETE, UPDATE are whose salary is below 10,000 and whose lastname
commands
starts with letter K.
Select one: Which SQL statement give the required output
a. DCL format of the salary?

b. DML Select one:

c. DDL a. SELECT last_name, TO_CHAR(salary,


'$999,999.99') AS "MONTHLY SALARY" FROM
d. All of the choices employees WHERE salary < 10000WHERE
last_name LIKE ‘K%’
Question 4
Answer saved b. SELECT last_name, TO_NUMBER(salary,
Marked out of 1.00 '$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000WHERE
last_name = ‘K%’
Question 8
c. SELECT last_name, TO_INTEGER(salary,
Answer saved
$999,999.99) AS "MONTHLY SALARY" FROM Marked out of
employees WHERE salary < 10000 WHERE 1.00
last_name IN '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%' Remove flag

Question 6 Question text


Answer saved You what to generate the average salary of all
Marked out of employees whose job function is FI_ACCOUNT.
1.00
Which of the following SQL command will produce the
output.
Select one:

Remove flag
a. SELECT AVG(salary) FROM employees
WHERE job_id = 'FI_ACCOUNT';

Question text b. SELECT AVE(salary) FROM employees


Which of the following is the correct report that will WHERE job_id = 'FI_ACCOUNT';
display the CLASS from table PARTS.
c. SELECT AVERAGE(salary) FROM employees
Select one: WHERE job_id = 'FI_ACCOUNT';
a. SELECT * CLASS FROM PARTS; d. SELECT COUNT AVG(salary) FROM
employees WHERE job_id = 'FI_ACCOUNT';
b. SELECT CLASS AS CLASS FROM PARTS;
Question 9
c. SELECT 'CLASS' FROM PARTS; Answer saved
Marked out of 1.00
d. SELECT CLASS FROM PARTS;

Question 7
Answer saved
Marked out of 1.00

Remove flag

Question text
Evaluate the following SQL command
Remove flag SELECT employee_id, min_salary, max_salary
Question text FROM employees, departments WHERE
salary>= 10000 && salary <= 20000
Evaluate the following SQL command
SELECT employee_id, salary, department_id FROM Select one:
employees WHERE department_id IN (60,70) a. The SQL will produce Cartesian Product
Select one: b. The SQL will display the employee id,
a. The SQL command will display employees with department id and the minimum and maximum salary
department id 60 or 70. whose salary is between 10000 and 20000.

b. The SQL command will give an incorrect c. The SQL command will give an incorrect
output. output.

c. The SQL command will produce an error. d. The SQL command will produce an error.

d. The SQL command will display employees with Question 10


department id 60 and 70. Answer saved
Marked out of 1.00
Flag question Flag question

Question text Question text


You want to display the employee's last name whose
salary is below 10,000 and whose lastname starts What is the SQL command to display the date of the
with letter D. first employee that was hired?
Which SQL statement give the required output format Select one:
of the salary?
a. SELECT FIRST(hire_date) FROM employees;
Select one:
b. SELECT hire_date FROM employees WHERE
a. SELECT last_name, TO_INTEGER(salary, TO_CHAR(hire_date) = ‘FIRST’;
$999,999.99) AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000 WHERE c. SELECT MIN(hire_date) FROM employees;
last_name IN 'D%'
d. SELECT hire_date FROM employees WHERE
b. SELECT last_name, TO_INT(salary, FIRST(hire_date );
'$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE Question 13
last_name STARTS 'D%' Answer saved
Marked out of 1.00
c. SELECT last_name, TO_CHAR(salary,
'$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000 WHERE
last_name LIKE 'D%'
d. SELECT last_name, TO_NUMBER(salary, Flag question
'$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10,000 WHERE Question text
last_name = ‘D%’
You want to display the employee id and the year
Question 11 when an employee was hired.
Answer saved Which SQL statement give the required output?
Marked out of 1.00
Select one:
a. SELECT employee_id,
YEAR(hire_date,'YYYY') FROM employees;
b. SELECT employee_id, YEAR(hire_date')
Flag question FROM employees;

Question text c. SELECT employee_id,


TO_YEAR(hire_date,'YYYY') FROM employees;
Which of the following will is the correct command to
create a role. d. SELECT employee_id,
TO_CHAR(hire_date,'YYYY') FROM employees;
Select one:
Question 14
a. CREATE ROLE gen_manager Answer saved
Marked out of 1.00
b. None of the choices
c. GRANT ROLE gen_manager
d. CREATE gen_manager ROLE

Question 12
Remove flag
Answer saved
Marked out of 1.00 Question text
Evaluate the following SQL command TRUE OR FALSE.
SELECT employee_id, hire_date, department_name A FOREIGN KEY is a field in one table that refers to
FROM employees, departments the PRIMARY KEY in another table.
WHERE departments.department_id =
employees.department_id Select one:
Select one: True
a. The SQL command will produce an error. False
b. The SQL command will give an incorrect Question 17
output. Answer saved
Marked out of 1.00
c. The SQL command should have ALIAS for the
table to produce a correct output.
d. The SQL command will produce a correct
output.

Question 15 Flag question


Answer saved
Marked out of 1.00
Question text
INDEX is an example of
privilege.
Select one:
a. System
Remove flag
b. None of the choices
Question text
c. Object
Display all the records whose stock is below 20 and in
warehouse number 3. d. Data
Select one: Question 18
Answer saved
a. SELECT * FROM parts WHERE onhand< 20 Marked out of
OR warehouse = 3; 1.00

b. SELECT * FROM parts WHERE onhand> 20


OR warehouse = 3;
c. SELECT * FROM parts WHERE onhand< 20
AND warehouse = 3; Flag question

d. SELECT * FROM parts WHERE onhand<= 20


Question text
AND warehouse = 3;
Ms. Ella what to generate the average salary of all
e. SELECT ALL FROM parts WHERE onhand< employees whose job function is IT_PROG.
20 AND warehouse = 3; Which of the following SQL command will produce the
output.
f. SELECT ALL FROM parts WHERE onhand<=
20 AND warehouse = 3; Select one:

Question 16 a. SELECT AVERAGE(salary) FROM employees


Answer saved WHERE job_id = 'IT_PROG';
Marked out of 1.00
b. SELECT AVE(salary) FROM employees
WHERE job_id = 'IT_PROG';
c. SELECT AVG(salary) FROM employees
WHERE job_id = 'IT_PROG';
Flag question d. SELECT COUNT AVG(salary) FROM
employees WHERE job_id = 'IT_PROG';
Question text
Question 19 Answer saved Marked out of 1.00 Select one:
a. SELECT * FROM employees SORT BY
lastname
b. SELECT * FROM employees ORDER BY
lastname AZ
c. SELECT * FROM employees ORDER BY
Flag question lastname
Question text d. SELECT * FROM employees SORT BY
A consists of a collection of DML statements that form a logicallastname
unit of work.
ascending
Select one:
All of the choices Question 22
Transaction Answer saved
Marked out of 1.00
SQL command
Database

Flag question

Question text
Question 20 Answer saved Marked out of 1.00
Austin David was transferred to Purchasing
Department. You are assigned to update the
database.
Which of the following SQL command will satisfy the
requirements?
Select one:
Remove flag
a. UPDATE first_name = ‘David’ AND last_name
Question text = ‘Austin’ FROM employees SET department_id = 30
Which of the following SELECT statement is the correct PL/SQL that will display all rows and columns?
Select one: b. UPDATE employees SET department_id = 30
SELECT TABLE PARTS; WHERE first_name = ‘David’ AND last_name =
SELECT FROM TABLE PARTS; ‘Austin’
SELECT * FROM PARTS; c. UPDATE department_id = 30 WHERE
SELECT ALL FROM PARTS; first_name = ‘David’ AND last_name = ‘Austin’
d. UPDATE employees WHERE department_id =
30 SET first_name = ‘David’ AND last_name =
‘Austin’

Question 23
Answer saved
Question 21 Answer saved Marked out of 1.00 Marked out of 1.00

Flag question

Remove flag Question text

Question text The General Manager request to the Database


Administrator
Display all the records in the employee table. Arrange the output to generate
in by lastname from A-Zthe total number of parts
order.
and total outstanding balance on hand of every class
in warehouse number 1&2.
Which of the following SQL command will generate What privileges that manipulates the content of the
the required output. database objects.
Select one: Select one:
a. SELECT warehouse, class, count(partnum), a. Object Privileges
sum(onhand) GROUP BY warehouse,class HAVING
warehouse = 1 or warehouse = 2 FROM parts; b. Connection Privileges
b. SELECT warehouse, class, count(partnum), c. Network Privileges
sum(onhand) GROUP BY warehouse,class WHERE
warehouse = 1 or warehouse = 2 FROM parts; d. System Privileges

c. SELECT warehouse, class, SUM(partnum), Question 26


SUM(onhand) FROM parts GROUP BY Answer saved
Marked out of 1.00
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; Remove flag

Question 24 Question text


Answer saved
Marked out of 1.00 Each row of data in a table can be uniquely identified
by a
Select one:
a. foreign key
b. primary key
Flag question
c. local key
Question text
d. relational key
John want to know how many employees receiving
salary below 10,000. e. index key
What SQL command he need to run?
Question 27
Select one: Answer saved
Marked out of 1.00
a. SELECT COUNT(salary) FROM employees
WHERE salary < 10,000;
b. SELECT COUNT(*) FROM employees
WHERE salary < 10000;
c. SELECT salary FROM Flag question
COUNT(employees)WHERE salary < 10000;
Question text
d. SELECT COUNT(emp_id) FROM employees
WHERE salary <= 10000; You want to display all the job position titles whose
salary is salary from 5,000 to 12,000 arrange from
Question 25 highest to lowest
Answer saved
Marked out of 1.00 Select one:
a. SELECT job_title FROM employees WHERE
salary >= 5000 AND salary <= 10000
b. SELECT employees_id, job_title FROM
employees WHERE salary >= 5000 AND salary <=
Flag question 10000
Question text
c. SELECT job_title FROM jobs WHERE salary
>= 5000 AND salary <= 10000 c. SELECT last_name, hire_date FROM
employees WHERE hire_date >= TO_DATE('2000',
d. SELECT job_title FROM jobs WHERE 'YYYY') AND hire_date <= TO_DATE('2002', 'YYYY')
min_salary >= 5000 AND max_salary<= 10000 OR salary > 5000;

Question 28 d. SELECT last_name, hire_date FROM


Answer saved employees WHERE hire_date >= TO_DATE('Jan-
Marked out of 1.00 2000', 'Month-YYYY') AND hire_date <=
TO_DATE('Dec-2002', 'Month-‘YYYY') AND salary >
5,000;

Question 30
Answer saved
Marked out of 1.00
Remove flag

Question text
Display all location id between 1000 to 2000.
Select one:
Flag question
a. DISPLAY location_id FROM departments
WHERE location_id LING 1000 UP TO 2000 Question text

b. SELECT location_id FROM departments There was 10% price increase in the all the parts in
WHERE location_id IN 1000 AND 2000 warehouse number 3. The Store Manager asked the
Database Administrator to generate a report showing
c. DISPLAY location_id FROM departments the part number, the old and new price.
WHERE location_id BETWEEN 1000 TO 2000 Which of the following SQL statement would satisfy
the requirement of the Store Manager.
d. SELECT location_id FROM departments
WHERE location_id BETWEEN 1000 AND 2000 Select one:

Question 29 a. SELECT partnum, price, price * 0.1 FROM


Answer saved parts WHERE warehouse = 3
Marked out of 1.00
b. SELECT partnum, price, price * 10% FROM
parts WHERE warehouse = 3
c. SELECT partnum, price, price * 1.1 FROM
parts WHERE warehouse = 3
Flag question d. SELECT partnum, price, price * 1.10% FROM
parts WHERE warehouse = 3
Question text
Question 31
You want to display the employee's last name and Answer saved
date hired in year 2002 whose salary is above 5000. Marked out of
Which SQL statement give the required output? 1.00

Select one:
a. SELECT last_name, hire_date FROM
employees WHERE hire_date >= TO_DATE('01-Jan-
2000', 'DD-Mon-YYYYY') AND hire_date <= Remove flag
TO_DATE('31-Dec-2002', 'DD-Mon-YYYY')AND
salary ABOVE 5000; Question text
You want to display the employee's last name and
b. SELECT last_name, hire_date FROM date hired in year 2000 to2006 whose salary is above
employees WHERE hire_date >= TO_DATE('01-Jan- 5000. Which SQL statement give the required output?
2002', 'DD-Mon-RR') AND hire_date <=
TO_DATE('31-Dec-2002', 'DD-Mon-RR') AND salary Select one:
> 5000;
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-2006', 'DD-Mon-
YYYY') AND salary ABOVE 5000;
Flag question
b. SELECT last_name, hire_date FROM
Question text
employees WHERE hire_date>=
ANSI SQL commands cannot be abbreviated. Select one:
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND
True False
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('Jan-2000', 'Month-YYYY') AND
hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') Question 34 Answer saved Marked out of 1.00
AND salary > 5,000;
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 32
Remove flag
Answer saved
Marked out of 1.00
Question text
Display the lastname of every employee in the company. Displ
Format: JuanReyes Select one:
SELECT CONCATENATE(first_name, last_name) AS Fullnam
None of the choices
SELECT CONCAT(first_name, last_name)
Remove flag FROM employees
Question text SELECT CONCAT(first_name, last_name) AS Fullname FROM

Which of the following SQL commands will display all


the stocks on hand from 10 to 30?
Select one:
a. SELECT * FROM parts WHERE BETWEEN
onhand = 10 AND onhand = 30;
b. SELECT * FROM parts WHERE onhand
BETWEEN 10 to 30;
Question 35 Answer saved Marked out of 1.00
c. SELECT * FROM onhand WHERE parts
BETWEEN onhand = 10 AND onhand = 30;
d. SELECT * FROM parts WHERE onhand
BETWEEN 10 AND 30;
e. SELECT * FROM parts WHERE BETWEEN
onhand>=10 to onhand<=30;
Remove flag
Question 33
Question text
Answer saved
Marked out of 1.00 Evaluate the following SQL command SELECT * FROM jobs W
Select one:
a. The SQL command will display all records in
the database b. SELECT employee_id, hire_date,
TO_DATE(hire_date,'Month') AS "Hired Month",
b. The SQL command will display all employees job_id FROM
with Manager position
c. SELECT employee_id, hire_date,
c. No records will be displayed MONTH(hire_date,'Month') AS "Hired Month", job_id
FROM employees
d. The SQL command will produce an error.
d. SELECT employee_id, hire_date,
Question 36 TO_CHAR(hire_date,'Month') AS "Hired Month",
Answer saved job_id FROM employees
Marked out of 1.00
Question 38
Answer saved
Marked out of 1.00

Flag question

Question text
Flag question
Aldrin wants to know the highest salary in every
department. Which of the following SQL command will Question text
display the required output? Which of the following describes the command
Select one: below?
SELECT * FROM employees WHERE department =
a. SELECT department_id, HIGH(salary) FROM 60 FOR UPDATE
employees GROUP BY department_id AND salary;
Select one:
b. SELECT department_id, HIGHEST(salary)
FROM employees GROUP BY salary; a. Locks the rows in the EMPLOYEES table with
department id is 60.
c. SELECT department_id, MAX(salary) FROM
employees GROUP BY department_id b. Unlock all records with department id = 60

d. SELECT department_id, MAXIMUM(salary) c. All users accessing the department id 60 can


FROM employees GROUP BY department_id; accept UPDATE command simultaneously.
d. Creates a temporary table with department =
Question 37
60
Answer saved
Marked out of 1.00
Question 39
Answer saved
Marked out of 1.00

Remove flag

Question text
Flag question
You want to display all the employee id and the month
an employee was hired. Question text
Which SQL statement give the required output? Display the employee id, number of years and the
Select one: hiring date of every employee in the company.

a. SELECT employee_id, hire_date, Select one:


TO_MONTH(hire_date,'Month') AS "Hired Month", a. SELECT employee_id, hire_date,
job_id FROM employees ROUND((SYSDATE - hire_date),0 /365,0) FROM
employees;
b. SELECT employee_id, hire_date,
ROUND((SYSDATE - hire_date) /365,0) FROM c. SELECT class, sum(onhand) AS "QTY ON
employees; HAND" FROM parts GROUP BY onhand

c. SELECT employee_id, hire_date, hire_date d. SELECT class, sum(onhand) AS "QTY ON


/365 FROM employees; HAND" FROM parts GROUP BY class

d. SELECT employee_id, hire_date, hire_date- Question 42


SYSDATE /365 FROM employees; Answer saved
Marked out of 1.00
Question 40
Answer saved
Marked out of 1.00

Remove flag

Question text

Flag question
Display the first 5 letter in the surname of all the
employees whose firstname starts with letter 'N'
Question text
Select one:
The DBA will create a new user name sales.
Which of the following SQL command will perform the a. SELECT SUBSTR(last_name,1,5), first_name
creation? FROM employees WHERE SUBSTR(first_name,1,1)
IN 'N'
Select one:
b. SELECT SUBSTR(last_name,1,5), first_name
a. CREATE USER FR0M DB_USER SET FROM employees WHERE SUBSTR(first_name,1,1)
user=’sales’ password=NULL = 'N'
b. None of the choices c. SELECT SUBSTR(surname,1,5), first_name
FROM employees WHERE first_name = 'N'
c. CREATE USERNAME sales SET PASSWORD
default d. SELECT SUBSTR(surname,1,5), first_name
FROM employees WHERE SUBSTR(first_name,1,1)
d. CREATE sales ACCESS 1234 IN 'N'
e. CREATE USER sales IDENTIFIED BY 1234 e. SELECT SUBSTR(last_name,1,5), first_name
FROM employees WHERE first_name IN 'N'
Question 41
Answer saved
Question 43
Marked out of 1.00
Answer saved
Marked out of 1.00

Flag question

Question text Flag question

Which of the following SQL command will display the Question text
summary table showing the total quantity on hand per
class. Display the employee id, salary, number of years and
the hiring date of every employee in the company.
Select one:
Select one:
a. SELECT class, TOTAL(onhand) AS "QTY ON
HAND" FROM parts GROUP BY class, onhand a. SELECT employee_id,salary, hire_date,
hire_date- SYSDATE /365 FROM employees;
b. SELECT class, onhand AS "QTY ON HAND"
FROM parts GROUP BY sum(onhand) b. SELECT employee_id, salary, hire_date,
hire_date /365 FROM employees;
Question 46
c. SELECT employee_id, salary, hire_date,
Answer saved
ROUND((SYSDATE - hire_date) /365,0) FROM Marked out of 1.00
employees;

Question 44
Answer saved
Marked out of 1.00

Remove flag

Question text
Display employee's name and id whose firstname
Flag question starts with letter D and job id is IT_PROG.
Sort the output by department.
Question text
Select one:
True or False. The AND, OR, NOT are comparison
operators. a. SELECT employees FROM employee_id,
first_name, last_name WHERE first_name LIKE ‘D%’
Select one: and job_id = ‘IT_PROG’ ORDER BY department_id
True b. SELECT employee_id, first_name, last_name
False FROM employees WHERE job_id = 'IT_PROG' OR
first_name LIKE 'D%' and ORDER BY department_id
Question 45
Answer saved
c. SELECT employee_id, first_name, last_name
Marked out of 1.00 FROM employees ORDER BY department_id
WHERE first_name LIKE 'D%' and job_id =
'IT_PROG'
d. SELECT employee_id, first_name, last_name
FROM employees WHERE first_name LIKE 'D%' and
job_id = 'IT_PROG' ORDER BY department_id
Flag question
Question 47
Question text
Answer saved
You want to display all the employee id and the month Marked out of 1.00
an employee was hired excluding employees whose
job id is AD_VP. Which SQL statement give the
required output?
Select one:
Flag question
a. SELECT employee_id, hire_date,
MONTH(hire_date,'Month') AS "Hired Month", Question text
job_id FROM employees WHERE job_id EXCLUDE TRUE OR FALSE.
('AD_VP'); An owner has all the privileges on the object.
b. SELECT employee_id, hire_date, Select one:
TO_CHAR(hire_date,'Month') AS "Hired Month",
job_id FROM employees WHERE job_id NOT IN True
('AD_VP'); False
c. SELECT employee_id, hire_date,
Question 48
TO_MONTH(hire_date,'Month') AS "Hired Month", Answer saved
job_id FROM employees WHERE job_id NOT Marked out of 1.00
('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';
Flag question Flag question

Question text Question text


What is the SQL command to count the number of records in th
You want to generate the total salary per month of Select one:
every department in the company. SELECT ALL FROM employees
Select one: SELECT * FROM employees;
SELECT COUNT(*) FROM employees
a. SELECT department_id, SUM(salary) FROM SELECT SUM(*) FROM employees;
employees GROUP BY department_id
b. SELECT department_id, salary FROM
employees ORDER BY SUM(salary)
c. SELECT department_id, salary FROM
employees GROUP BY SUM(salary) ORDER BY
department_id
Question 1
d. SELECT department_id, TOTAL(salary) FROM Complete
employees GROUP BY department_id Mark 2.00 out of 2.00 Flag question

Question 49
Answer saved Question text
Marked out of 1.00
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:
Flag question
a. SELECT job_title FROM jobs WHERE min_salary
>= 5000 AND max_salary<= 10000
Question text b. SELECT job_title FROM employees WHERE salary
>= 5000 AND salary <= 10000
Which of the following SQL commands will display all c. SELECT employees_id, job_title FROM
stocks whose class is HW or AP. employees WHERE salary >= 5000 AND salary
Select one: <= 10000
d. SELECT job_title FROM jobs WHERE salary >=
a. SELECT * FROM parts WHERE IN (class =
Question 2
‘HW’, class= ‘AP’);
Complete
Mark 2.00 out of 2.00 Flag question
b. SELECT ALL FROM class WHERE parts IN =
(‘HW’, ‘AP’);
Question text
c. SELECT * FROM parts WHERE IN class What is the SQL command to count the number of records in the e
('HW', 'AP'); Select one:
d. SELECT ALL FROM parts WHERE IN class = SELECT ALL FROM employees
(‘HW’, ‘AP’); SELECT * FROM employees;
SELECT COUNT(*) FROM employees
e. SELECT * FROM parts WHERE class IN SELECT SUM(*) FROM employees;
('HW', 'AP');

Question 50
Answer saved
Marked out of 1.00 Question 3
Complete
Mark 2.00 out of
2.00 Flag question
Question text a. SELECT department_id, salary FROM
True or False. The AND, OR, NOT are comparison operators. employees ORDER BY SUM(salary)
Select one: True b. SELECT department_id, TOTAL(salary)
False FROM employees GROUP BY
department_id
c. SELECT department_id, salary FROM employees
GROUP BY SUM(salary) ORDER BY
department_id
Question 4
Complete Question 7
Mark 2.00 out of 2.00 Flag question Complete
Mark 2.00 out of 2.00 Flag question

Question text
Question job_title
Evaluate the following SQL command SELECT * FROM jobs WHERE text LIKE 'Manager%'
Select one: You want to display the employee's last name whose salary is belo
The SQL command will produce an error. Which SQL statement give the required output format of the salary?
Select one:
The SQL command will display all employees with Manager position
The SQL command will display all records in the database SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY
No records will be displayed SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTH
SELECT last_name, TO_INTEGER(salary,
$999,999.99) AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000 WHERE last_name IN 'D%'
SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MON

Question 5
Complete
Mark 2.00 out of 2.00 Flag question

Question text
You want to display all the employee id and the month an employee was hired.
Which SQL statement give the required output?
Select one:
SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month", job_id FROM
SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month", job_id FROM employees
SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month", job_id FROM employees
Question 8
SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month", job_id FROM employees
Complete
Mark 2.00 out of 2.00 Flag question

Question text
Display the lastname of every employee in the company. Display th
Format: JuanReyes
Select one:
None of the choices
SELECT CONCATENATE(first_name, last_name) AS Fullname FR
SELECT CONCAT(first_name, last_name) FROM employees
SELECT CONCAT(first_name, last_name) AS Fullname FROM em
Question 6
Complete
Mark 2.00 out of 2.00 Flag question

Question text
You want to generate the total salary per month of every department in the company.
Select one:
Question 9
Complete
Mark 0.00 out of
2.00 Flag question
Flag question
Question text
Question text
Display the first 5 letter in the surname of all the
Evaluate the following SQL command
employees whose firstname starts with letter 'N'
SELECT employee_id, salary, department_id FROM employees W
Select one: Select one:
a. SELECT SUBSTR(last_name,1,5), first_name The SQL command will produce an error.
FROM employees WHERE first_name IN 'N' The SQL command will display employees with department id 60 a
b. SELECT SUBSTR(last_name,1,5), first_name The SQL command will give an incorrect output.
FROM employees WHERE The SQL command will display employees with department id 60 o
SUBSTR(first_name,1,1) = 'N'
c. SELECT SUBSTR(surname,1,5), first_name
FROM employees WHERE
SUBSTR(first_name,1,1) IN 'N'
d. SELECT SUBSTR(surname,1,5), first_name
FROM employees WHERE first_name = 'N' Question 13
Complete
Question 10 Mark 2.00 out of 2.00 Flag question
Complete
Mark 2.00 out of 2.00 Flag question
Question text
You want to display the employee's last name and date hired in yea
Question text
Select one:
Austin David was transferred to Purchasing Department. You are assigned to update the database.
SELECT last_name, hire_date FROM employees WHERE hire_da
Which of the following SQL command will satisfy the requirements?
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND
Select one:
hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR') AND salary >
UPDATE first_name = ‘David’ AND last_name = ‘Austin’ FROM employees SET department_id = 30
SELECT last_name, hire_date FROM employees WHERE hire_da
UPDATE department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’
TO_DATE('Jan-2000', 'Month-YYYY') AND
UPDATE employees WHERE department_id = 30 SET first_name = ‘David’ AND last_name = ‘Austin’
hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') AND salary > 5
UPDATE employees SET department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’
SELECT last_name, hire_date FROM employees WHERE hire_da
TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND
hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon- YYYY') AND sala
SELECT last_name, hire_date FROM employees WHERE hire_da
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2006', 'YY

Question 11
Complete
Mark 2.00 out of 2.00 Flag question

Question text
John want to know how many employees receiving salary below 10,000.
What SQL command he need to run?
Select one: Question 14
SELECT COUNT(*) FROM employees WHERE salary Complete
< 10000; Mark 2.00 out of 2.00 Flag question
SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
Question text
SELECT salary FROM COUNT(employees)WHERE salary < 10000;
List all employees except for IT_PROG job id. Select one:
SELECT *FROM employees EXCEPT JOB_ID !=
'IT_PROG'
SELECT *FROM employees WHERE JOB_ID NOT IN ('IT_PROG')
SELECT *FROM employees WHERE JOB_ID <> 'IT_PROG'

Question 12
Complete
Mark 2.00 out of 2.00
d. All of the choices Question 18
Complete
Question 15 Mark 2.00 out of 2.00 Flag question
Complete
Mark 2.00 out of 2.00 Flag question
Question text
You what to generate the average salary of all employees whose jo
Question text Select one:
Evaluate the following SQL command SELECT AVERAGE(salary) FROM employees WHERE job_id = 'F
SELECT employee_id, min_salary, max_salary FROM employees, departments
SELECT WHERE
AVG(salary) FROMsalary>= 10000
employees && salary
WHERE <= =20000
job_id 'FI_ACC
Select one: SELECT AVE(salary) FROM employees WHERE job_id = 'FI_ACC
The SQL will produce Cartesian Product SELECT COUNT AVG(salary) FROM employees WHERE job_id =
The SQL will display the employee id, department id and the minimum and maximum salary whose salary is between 10000 and
The SQL command will produce an error.
The SQL command will give an incorrect output.

Question 16 Question 19
Complete Complete
Mark 2.00 out of 2.00 Flag question Mark 2.00 out of 2.00 Flag question

Question text Question text


Display all the records in the employee table. Arrange the output in by all
Display lastname
locationfrom A-Z order.
id between 1000 to 2000. Select one:
Select one: DISPLAY location_id FROM departments WHERE
SELECT * FROM employees SORT BY lastname location_id LING 1000 UP TO 2000
SELECT * FROM employees ORDER BY lastname DISPLAY location_id FROM departments WHERE location_id BET
SELECT * FROM employees ORDER BY lastname AZ SELECT location_id FROM departments WHERE location_id IN 10
SELECT * FROM employees SORT BY lastname ascending SELECT location_id FROM departments WHERE location_id BETW

Question 17
Complete
Mark 2.00 out of 2.00 Flag question
Question 20
Complete
Question text Mark 2.00 out of 2.00 Flag question
Display employee's name and id whose firstname starts with letter D and job id is IT_PROG.
Sort the output by department. Question text
Select one: What will be the SQL command if every employee will be given a p
SELECT employee_id, first_name, last_name FROM employees ORDER
Display BY department_id
the employee id, salaryWHERE
and the first_name
productivityLIKE 'D%' and j
bonus.
SELECT employees FROM employee_id, first_name, last_name WHERE
Select one: first_name LIKE ‘D%’ and job_id
= ‘IT_PROG’ ORDER BY department_id SELECT employee_id, salary, salary + (salary .03)
SELECT employee_id, first_name, last_name FROM employees FROMWHERE job_id = 'IT_PROG' OR first_name LIKE 'D%' and ORD
employees
SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE
SELECT employee_id, 'D%'
salary, and* job_id
salary .03 FROM employees
= 'IT_PROG' ORDER BY department_id SELECT employee_id, salary, salary * 1.03 FROM employees
SELECT employee_id, salary FROM employees WHERE salary)
e.

SELECT
Complete
employee_id, salary, salary * .30 FROM
Mark 2.00 out of 2.00 Flag question

Question text
In creating Joins,the NATURALJOIN and USING clauses are
Select one:
Mutually Inclusive
Limited to 2 relational tables
Opposite
Mutually Exclusive
SELECT employee_id,salary, hire_date, hire_date- SYSDATE /365 FROM employees;
SELECT employee_id, salary, hire_date, ROUND((SYSDATE - hire_date) /365,0) FROM employees;
SELECT employee_id, salary, hire_date, hire_date
/365 FROM 22
Questionemployees; Question 24
Complete Complete
Mark 2.00 out of 2.00 Flag question Mark 4.00 out of 4.00
Flag question

Question text Question text


Display the employee's name, job title, job_id and the department name of employees with department id of 100.
Select one: Display employee id, lastname, firstname, department
SELECT E.employee_id, J.job_title, e.job_id, D.department_name name, annual salary, location id of employees whose
FROM employees E location id is 1700 and working in Finance
JOIN jobs J ON E.job_id = J.job_id Department. Label the annual salary to ANNUAL
JOIN departments D ON E.department_id = D.department_id SALARY.
WHERE E.department_id = 100 Sort the output in from highest to lowest salary. (4
SELECT E.employee_id, J.job_title, e.job_id, D.department_name POINTS)
FROM employees E
Select one:
JOIN department D ON E.job_id = J.job_id
a. SELECT E.employee_id, E.last_name, E.first_name,
JOIN jobs J ON E.department_id = D.department_id WHERE E.department_id = 100
D.department_name, E.salary*12 AS "ANNUAL
SELECT E.employee_id, J.job_title, e.job_id, D.department_name
SALARY", D.location_id
FROM jobs J
FROM employees E
INNER JOIN department D ON E.job_id = J.job_id INNER JOIN employees EON E.department_id = D.department_id
NATURAL JOIN jobs J ON E.job_id = J.job_id
WHERE E.department_id = 100
NATURAL JOIN departments D ON E.department_id
SELECT E.employee_id, J.job_title, e.job_id, D.department_name
= D.department_id
FROM jobs J
ORDER BY "ANNUAL SALARY" DESC
NATURAL JOIN department D ON E.job_id = J.job_id NATURAL JOIN employees E ON E.department_id = D.department_id
WHERE D.location_id = 1700 AND
WHERE E.department_id = 100
D.department_name = 'Finance'
b. SELECT E.employee_id, E.last_name, E.first_name,
D.department_name, E.salary*12 AS "ANNUAL
SALARY", D.location_id
FROM employees E
JOIN jobs J ON E.job_id = J.job_id
JOINemployees E ON E.department_id =
D.department_id
WHERE D.location_id = 1700 AND
D.department_name = 'Finance'
ORDER BY "ANNUAL SALARY" DESC
c. SELECT E.employee_id, E.last_name, E.first_name,
D.department_name, E.salary*12 AS "ANNUAL
SALARY", D.location_id
FROM employees E
Question 23
JOIN jobs J ON E.job_id = J.job_id
JOIN departments D ON E.department_id =
D.department_id
WHERE D.location_id = 1700 AND
D.department_name = 'Finance'
ORDER BY "ANNUAL SALARY" DESC
d. SELECT E.employee_id, E.last_name, E.first_name, SELECT * FROM parts WHERE onhand< 20 AND
D.department_name, E.salary*12 AS "ANNUAL warehouse = 3;
SALARY", D.location_id
FROM employees E Ronnie is the stockman in the warehouse of ATR
OUTER JOIN jobs J ON E.job_id = J.job_id Corporation. The General Manager wants to know the
OUTER JOIN departments D ON E.department_id = parts whose price is above 10000 and above. Which of
D.department_id the following SQL command that Ronnie will run to
WHERE D.location_id = 1700 AND
generate the list.
D.department_name = 'Finance'
ORDER BY "ANNUAL SALARY" SELECT * FROM parts WHERE price >= 10000;
DESC
Which of the following SQL command will display all
records with class code of AP?
SELECT * FROM parts WHERE class = ‘AP’;

Which of the following SQL commands will display all


stocks whose class is HW or AP.
SELECT * FROM parts WHERE IN class ('HW', 'AP');
LA2

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 LA3
order.
SELECT first_name, last_name, salary FROM
employees WHERE department_id = 100 AND salary < Display the first 5 letter in the surname of all the
8000 ORDER BY salary employees whose firstname starts with letter 'D'
SELECT SUBSTR(last_name,1,5), first_name FROM
Display employee's name and id whose firstname starts employees WHERE SUBSTR(first_name,1,1) = 'D'
with letter D and job id is SA_REP. Sort the output by
department. Display the employee id, number of years and the hiring
SELECT employee_id, first_name, last_name FROM date of every employee in the company.
employees WHERE first_name LIKE 'D%' and job_id = SELECT employee_id, hire_date, ROUND((SYSDATE -
'IT_PROG' ORDER BY department_id hire_date) /365,0) FROM employees;

List all the employee_id of all employees whose salary is Every employee will get a bonus of 150% of his/her
5000 and below and belong to department 60 or 100. current salary. Display the employee id, salary and the
SELECT employee_id,salary, department_id FROM bonus of every employee. Label the computed bonus
employees WHERE salary < 5000 AND department_id with Bonus
IN (60,100) The correct answer is: SELECT employee_id, salary,
salary * 1.5 AS Bonus FROM employees

---------------------------------------- ----------------------------------------
SQ2 SQ3

Display all the records sorted by price from most Display the montly salary of every employee. Round the
expensive to the cheapest parts. salary in 2 decimal places.
SELECT * FROM parts ORDER BY price DESC SELECT ROUND( (salary/12),2 ) FROM employees;

Display all the records whose stock is below 20 and in Display the total number of characters of the last name
warehouse number 3. of all the employees.
SELECT LENGTH(last_name) FROM employees; id is AD_VP. Which SQL statement give the required
output?
Display the first 3 letter in the first name of all the SELECT employee_id, hire_date,
employees. TO_CHAR(hire_date,'Month') AS "Hired Month",
SELECT SUBSTR(first_name,1,3) FROM employees; job_id FROM employees WHERE job_id NOT IN
('AD_VP');
Display the last day of the month and the hiring date
when the employees are hired in the company. You want to display the employee's id and formatted
SELECT LAST_DAY(hire_date), hire_date FROM date hired as shown below.
employees; Which SQL statement give the required output?
Required output :
---------------------------------------- SELECT employee_id, TO_CHAR(hire_date, 'fmMonth
LA4 DD, YYYY') AS "Hired Date" FROM employees;

----------------------------------------
You want to display the employee id and the year when LA5
an employee was hired.
Which SQL statement give the required output?
SELECT employee_id, TO_CHAR(hire_date,'YYYY') The General Manager request to the Database
FROM employees; Administrator to generate the total salary per month of
every department in the company.
You want to display the employee id and the month an SELECT department_id, SUM(salary) FROM employees
employee was hired. GROUP BY department_id
Which SQL statement give the required output?
SELECT employee_id, hire_date, Ms. Ella what to generate the average salary of all
TO_CHAR(hire_date,'Month') AS "Hired Month" FROM employees whose job function is IT_PROG.
employees; Which of the following SQL command will produce the
output.
You want to display the employee's last name whose SELECT AVG(salary) FROM employees WHERE job_id =
salary is below 10,000. 'IT_PROG';
Which SQL statement give the required output format
of the salary? Aldrin wants to know the highest salary in every
Required output : department. Which of the following SQL command will
SELECT last_name, TO_CHAR(salary, '$999,999.99') AS display the required output?
"MONTHLY SALARY" FROM employees WHERE salary < SELECT department_id, MAX(salary) FROM employees
10000 GROUP BY department_id

What is the SQL command to display the date of the


first employee that was hired?
---------------------------------------- SELECT MIN(hire_date) FROM employees;
SQ4
John want to know how many employees receiving
salary below 10,000. What SQL command he need to
run?
SELECT COUNT(*) FROM employees WHERE salary <
You want to display the last name and the year when an 10000;
employee was hired whose job id is IT_PROG.
Which SQL statement give the required output? ----------------------------------------
SELECT last_name, TO_CHAR(hire_date,'YYYY') FROM LQ1
employees WHERE job_id = ‘IT_PROG’;

You want to display all the employee id and the month John want to know how many part items are there in
an employee was hired excluding employees whose job warehouse number 3.
What SQL command he need to run? (job_id);
SELECT COUNT(*) FROM parts WHERE warehouse = 3;

Which of the following SQL command will display all What will be the output of the SQL command below?
records with part number contains the number 9? SELECT first_name, last_name, job_title FROM
SELECT * from parts WHERE partnum LIKE '%9%' employees CROSS JOIN jobs ORDER BY last_name;
A Cartesian product

What will be the output of the following SQL? What will be the output of the SQL command below?
SELECT * FROM parts WHERE (warehouse = 1 or SELECT last_name, job_id, job_title FROM employees
warehouse = 2) AND class IN ('HW', 'AP') AND (price > NATURAL JOIN jobs
200 AND price < 500); List of names and job title of matched records from the
2 rows returned employees and jobs table

----------------------------------------
What will be the output of the SQL command? SQ6
SELECT SUM(onhand) FROM PARTS where class = 'HW'
OR class = 'AP' AND warehouse = 1;
137 Given the SQL command
SELECT * FROM employees JOIN departments USING
There was 10% price increase in the all the parts in (department_id)
warehouse number 3. The Store Manager asked the Which of the following describes the SQL command?
Database Administrator to generate a report showing Joined table from the employees and department
the part number, the old and new price. table
Which of the following SQL statement would satisfy the
requirement of the Store Manager.
SELECT partnum, price, price * 1.1 FROM parts WHERE Display the location id of all employee's name and
warehouse = 3 salary whose salary is from 5000 to 10000.
SELECT first_name, last_name, salary FROM
Which of the following SQL command will display the employees JOIN departments USING (department_id)
summary table showing the total quantity on hand per WHERE salary >= 5000 AND salary <= 10000
class.
SELECT class, sum(onhand) AS "QTY ON HAND" FROM Display the manager id and employee id of every
parts GROUP BY class employee
SELECT E.employee_id, D.manager_id FROM
employees E JOIN departments D ON E.department_id
Aldrin wants to know the outstanding total balance on = D.department_id
hand on every class per warehouse.
SELECT warehouse, class, sum(onhand) FROM parts Given the SQL command
GROUP BY warehouse, class SELECT employees.first_name, employees.last_name,
employees.salary,departments.department_name
---------------------------------------- FROM employees, departments
LA6 WHERE employees.department_id =
departments.department_id;
Which of the following describes the SQL command?
List of employees name, salary and department name

The HR Manager instruct the Database Officer to display ----------------------------------------


employee's name and the minimum and maximum LA7
salary the employee can received. Which of the
following SQL command will generate the output?
SELECT first_name, last_name, job_id, min_salary, Remove the Shareholder Services department in the
max_salary FROM employees JOIN jobs USING department table
DELETE FROM departments WHERE department_name TRUNCATE TABLE departments
= ‘Shareholder Services’
SQL command to create a marker in the current
transaction.
A new department name Training with department id SAVEPOINT
300 was created in the company. This will be managed
by a Manager with ID of 203 and will located at location Nathaniel had accidentally deleted all the records in the
id 2400. newly updated ORACLE database using the DELETE SQL
Create a SQL command to update the information in the command. What is the best solution that he can do to
department table. restore all the deleted records in the database.
INSERT INTO departments VALUES (300, 'Training', Run the ROLLBACK command
203, 2400)

Create a SQL command to add a new position Database LA8


Administrator with job id of DB_ADMIN whose salary
ranges from 10,000 to 18,000. Which of the following will grant a query privileges on
INSERT INTO jobs VALUES ('DB_ADMIN', 'Database the STUDENT table
Administrator', 10000, 18000) GRANT select ON student TO matt

Remove all Manager positions in the department table. You want to cancel the privilege of matt to add records
DELETE FROM jobs WHERE job_title LIKE '%Manager from the employees table.
%'; REVOKE insert ON employees FROM matt;

SQ7 This has the highest level of privileges for task such as
creating new users, removing users and tables and
backing up tables.
DBA
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. ----------------------------------------
INSERT INTO jobs VALUES ('JAVA_DEV', 'Java SQ8
Developer', 7000, 8000)

TRUE OR FALSE.
Add a 500 pesos increase in salary of all employees who An owner has all the privileges on the object.
have rendered services 10 years and above. True
UPDATE employees SET salary = salary + 500 where
TO_CHAR(sysdate,'YYYY') - TO_CHAR(hire_date,'YYYY') Which of the following provide privilege to update the
>= 10 employees table?
GRANT update (salary) ON employees TO matt

Which of the following DOES NOT describes the state of Which of the following will is the correct command to
the data after the COMMIT command create a role.
None of the choices CREATE ROLE gen_manager

Which of the following describes the command below? Matt wants to change his password from 1234 to abcd.
SELECT * FROM employees WHERE department = 60 Which of the following will perform the task?
FOR UPDATE ALTER USER matt IDENTIFIED abcd;
Locks the rows in the EMPLOYEES table with
department id is 60. The DBA will create a new user name sales.
Which of the following SQL command will perform the
Which of the following will erase all records in the creation?
departments table CREATE sales ACCESS 1234
'FI_ACCOUNT';

Which of the following SQL command that the DBA will


run to provide Matt to create a table in the Oracle You want to display all the job position titles whose
Database. salary is salary from 5,000 to 12,000 arrange from
GRANT create table TO matt highest to lowest
SELECT job_title FROM jobs WHERE min_salary >=
5000 AND max_salary<= 10000
What privileges that manipulates the content of the
database objects. List all employees except for IT_PROG job id.
Object Privileges All of the choices

Austin David was transferred to Purchasing


Department. You are assigned to update the database.
Which of the following SQL command will satisfy the
---------------------------------------- requirements?
1st Q Exam UPDATE employees SET department_id = 30 WHERE
first_name = ‘David’ AND last_name = ‘Austin’

Evaluate the following SQL command Display the lastname of every employee in the
SELECT employee_id, salary, department_id FROM company. Display the output in a single column and
employees WHERE department_id IN (60,70) label it as Fullname
The SQL command will display employees with Format: JuanReyes
department id 60 or 70. SELECT CONCAT(first_name, last_name) AS Fullname
FROM employees
True or False. The AND, OR, NOT are comparison
operators. Evaluate the following SQL command
False SELECT * FROM jobs WHERE job_title LIKE 'Manager%'
No records will be displayed
What is the SQL command to count the number of
records in the employees table?
SELECT COUNT(*) FROM employees Display all the records in the employee table. Arrange
the output in by lastname from A-Z order.
SELECT * FROM employees ORDER BY lastname
What will be the SQL command if every employee will
be given a productivity bonus which is equivalent to 3% You want to generate the total salary per month of
of the monthly salary? every department in the company.
Display the employee id, salary and the productivity SELECT department_id, SUM(salary) FROM employees
bonus. GROUP BY department_id
SELECT employee_id, salary, salary * .03 FROM
employees You want to display the employee's last name whose
salary is below 10,000 and whose lastname starts with
Display the employee id, salary, number of years and letter D.
the hiring date of every employee in the company. Which SQL statement give the required output format
SELECT employee_id, salary, hire_date, of the salary?
ROUND((SYSDATE - hire_date) /365,0) FROM SELECT last_name, TO_INTEGER(salary, $999,999.99)
employees; AS "MONTHLY SALARY" FROM employees WHERE
salary < 10000 WHERE last_name IN 'D%'
You what to generate the average salary of all
employees whose job function is FI_ACCOUNT.
Which of the following SQL command will produce the In creating Joins,the NATURALJOIN and USING clauses
output. are
SELECT AVG(salary) FROM employees WHERE job_id = Mutually Exclusive
Answer: True
Display employee id, lastname, firstname, department How do you test the output of a PL/SQL block?
name, annual salary, location id of employees whose Answer: Use a predefined Oracle package and its
location id is 1700 and working in Finance Department. procedure
Restrictive, specifies a RETURN type, associates only
Label the annual salary to ANNUAL SALARY.
with type-compatible queries are description of a
Sort the output in from highest to lowest salary. (4 .
POINTS) Answer: Strong REF CURSOR
SELECT E.employee_id, E.last_name, E.first_name, Which of the following DOES NOT describes an
D.department_name, E.salary*12 AS "ANNUAL exception?
SALARY", D.location_id Answer: Exception is a PL/SQL error that is raised
FROM employees E before program execution.
JOIN jobs J ON E.job_id = J.job_id These are local variables declared in the parameter
JOIN departments D ON E.department_id = list of a subprogram specification.
Answer: Formal parameter
D.department_id
Which of the following rules is INCORRECT about
WHERE D.location_id = 1700 AND D.department_name cursor variables?
= 'Finance' Answer: None of the choices.
ORDER BY "ANNUAL SALARY" DESC When an exception is predefined by Oracle server,
the exception is raised .
Answer: Explicitly
Which of the following DOES NOT describes an
exception?
Answer: Exception is a PL/SQL error that is raised
before program execution.
Which of the following does NOT describes SELECT
Evaluate the following PL/SQL.
Statement in a PL/SQL.
CREATE OR REPLACE PROCEDURE
Answer: Queries must return only one column.
query_employee
You want to display all the records of employee the
(p_id IN employees.employee_id%TYPE,
same with the salary employee number 103.
p_name OUT employees.last_name%TYPE,
Answer: SELECT * FROM employees WHERE salary
p_salary OUT employees.salary%TYPE) IS
= (SELECT salary from employees where
BEGIN SELECT last_name, salary INTO p_name,
employee_id= 103)
p_salary
Which of the following stored procedure to create a
FROM employeesWHERE employee_id = p_id;
procedure to that will be used to display the employee
END query_employee
id and salary of Steven King?
Answer: No error
Answer: CREATE OR REPLACE PROCEDURE
You want to know the total number of employees
query_emp
whose firstname starts with letter D.
(p_last_name IN employees.last_name%TYPE,
Which of the folllowing PLS/SQL executes
p_first_name IN employees.first_name%TYPE,
successfully?
p_employee_id OUT employees.employee_id
Answer: DECLARE
%TYPE,
v_first_name employees.first_name%TYPE := 'D%';
p_salary OUT employees.salary%TYPE) IS
BEGIN
BEGIN
SELECT COUNT(*) INTO v_first_name FROM
SELECT employee_id, salary INTO p_employee_id,
employees WHERE first_name LIKE v_first_name;
p_salary
DBMS_OUTPUT.PUT_LINE(v_first_name);
FROM employees
END;
WHERE last_name = p_last_name AND first_name =
What is the error trapping function that returns the
p_first_name;
numeric value of the error code?
END query_emp;
Answer: SQLCODE
Which of the folllowing is TRUE?
You want to display the name, salary and tax of
Answer: SQL code are embedded within PL/SQL
employee #150. Which of the PL/SQL will execute
statements
successfully? Note tax is computed as 2% of the
When an exception is user defined, the exception is
salary.
raised .
Answer: DECLARE
Answer: Explicitly
v_first_name VARCHAR2(50);
Which of the folllowing is TRUE?
v_last_name VARCHAR2(50);
Answer: SQL code are embedded withing PL/SQL
v_salary INTEGER(20);
statements
v_tax INTEGER(10);
Weak REF CURSOR is very flexible.
BEGIN What is the exception name when PL/SQL has an
SELECT first_name, last_name, salary, salary * 0.02 internal problem
INTO v_first_name, v_last_name, v_salary, v_tax Answer: PROGRAM_ERROR
FROM employees WHERE employee_id = 150; Which of the folllowing statement describes PL/SQL?
DBMS_OUTPUT.PUT_LINE('Firstname : '|| Answer: PL/SQL is an Oracle proprietary, procedural,
v_first_name); 3GL programming language
DBMS_OUTPUT.PUT_LINE('Lastname : '|| Evaluate the following PL/SQL.
v_last_name); DECLARE
DBMS_OUTPUT.PUT_LINE('Salary : '|| v_employee_id employees.employee_id%TYPE :=
v_salary); DBMS_OUTPUT.PUT_LINE('Tax : '|| 114;
v_tax); END; BEGIN
Which of the following is the syntax to close a cursor? DELETE employees WHERE employee_id =
Answer: CLOSE cursor_variable_name; v_employee_id;
Which of the following rules is INCORRECT about END;
cursor variables? Answer: The PL/SQL will delete employee number
Answer: None of the choices. 114.
What are the three PL/SQL block types? Which of the following command is used to create a
Answer: Anonymous, Procedure, Function stand-alone procedure that is stored in the Oracle
You can trap any error by including a corresponding database?
handler within the exception-handling section of the Answer: CREATE PROCEDURE
PL/SQL block. Evaluate the following PL/SQL.
Answer: True DECLARE
Which of the following describes weak REF v_email VARCHAR(20);
CURSOR? BEGIN
Answer: Associates with any query SELECT email INTO v_email FROM EMPLOYEES
Given the answer in item , which of the WHERE email like 'D%';
folllowing stored procedure will display the employee DBMS_OUTPUT.PUT_LINE ('Employees whose
id and salary of Steven King? email address starts with letter D :'
Answer: DECLARE || v_email);
v_employee_id employees.employee_id%TYPE; EXCEPTION
v_emp_sal employees.salary%TYPE; WHEN TOO_MANY_ROWS THEN
BEGIN DBMS_OUTPUT.PUT_LINE (' Your select statement
query_emp('King', 'Steven', v_employee_id, retrieved multiple rows.');
v_emp_sal); END;
DBMS_OUTPUT.PUT_LINE('Employee ID ' || Answer: The PL/SQL block will run successfully.
v_employee_id ||' earns '|| to_char(v_emp_sal, Which of the following is the syntax to define a REF
'$999,999.00')); CURSOR type?
END; Answer: TYPE ref_type_name IS REF CURSOR
You have been tasked to update the database by [RETURN return_type];
creating a PL/SQL to increase the salary of all IT The PL/SQL code block helps modularize code by
Programmer employees by 50% of their existing using:
salary. Answer: All of the choices
Which of the following will execute successfully? Which of the following is the syntax to fetch from a
Answer: DECLARE cursor variable?
v_job_id employees.job_id%TYPE := 'IT_PROG'; Answer: FETCH cursor_variable_name INTO
BEGIN variable_name1
UPDATE employees SET salary = salary *0.50 [,variable_name2,. . .] | record_name;
WHERE job_id = v_job_id; You want to display all records in the database whose
END; salary is above the salary of Alexander Hunold.
Which of the folllowing is required in a subquery? Answer: SELECT * from employees WHERE salary <
Answer: SELECT (SELECT salary FROM employees WHERE
What is the exception name when PL/SQL has an first_name = 'Alexander' AND last_name = 'Hunold')
internal problem Procedure can be stored in the database as a
Answer: PROGRAM_ERROR schema object.
In the DECLARE section of the PL/SQL block, Answer: True
Answer: All of the choices In PL/SQL Block Structure, which of the following are
Actions are being performed when error occurs during mandatory?
PL/SQL execution in the Answer: BEGIN and END
Answer: EXCEPTION PL/SQL stands for
Answer: Procedural Language extension to SQL CURSOR type?
Which of the following is CORRECT about sub-
Answer: TYPE ref_type_name IS REF CURSOR
queries?
Answer: Subquery execute before the main query [RETURN return_type];
executes. Weak REF CURSOR is very flexible.
Which of the following does NOT describes SELECT Answer: True
Statement in a PL/SQL. Evaluate the following. What will be the output?
Answer: Queries must return only one column. DECLARE
PL/SQL Provides a block structure for executable SUBTYPE Accumulator IS NUMBER (4,2);
units of . v_amount accumulator;
Answer: Code v_num1 NUMBER;
Evaluate the SQL command
v_num2 NUMBER;
SELECT employee_id, salary from employees where
salary = ANY (SELECT salary FROM employees v_num3 NUMBER;
WHERE job_id = 'IT_PROG') AND job_id = BEGIN
'ST_CLERK' v_amount := 10.50;
Answer: This has no error. v_num1 := 1;
Which of the following PL/SQL will execute v_num2 := 2;
successfully? v_num3 := 3;
Answer: DECLARE v_num1 := v_amount;
v_salary INTEGER(20); v_num2 := v_num1 + v_amount;
BEGIN
v_num2 := v_num2 - v_num3;
SELECT salary INTO v_salary FROM employees
WHERE employee_id = 150; dbms_output.put_line('Total is: ' || v_num2);
END; END;
In PL/SQL Block Structure, which of the following are Answer: 18
OPTIONAL? Which of the following is the syntax to fetch from a
Answer: None of the choices cursor variable?
Evaluate the following PL/SQL. At what line number is Answer: FETCH cursor_variable_name INTO
the error of the PL/SQL? variable_name1
DECLARE [,variable_name2,. . .] | record_name;
v_deptno NUMBER := 800;
Fetch into a record when fetching from a cursor.
e_invalid EXCEPTION;
BEGIN Answer: True
DELETE FROM departments Which of the following is the syntax to close a cursor?
WHERE department_id = v_deptno; Answer: CLOSE cursor_variable_name;
IF SQL % NOT_FOUND THEN This is a subset of an existing data type that may place a
RAISE e_invalid; constraint on its base type.
END IF; Answer: Subtype
COMMIT; Which of the following rules is INCORRECT about cursor
EXCEPTION variables?
WHEN e_invalid THEN
Answer: None of the choices.
DBMS_OUTPUT.PUT_LINE('No such department
id.'); Use column aliases in cursors for calculated columns
END; fetched into records declared with %COLUMNTYPE.
Answer: 7 Answer: False
What is the error trapping function that returns the
numeric value of the error code? PROG-113A / ► Week 18: Designing PL/SQL / ►
Answer: SQLCODE Learning Activity 14
Fetch into a record when fetching from a cursor.
Answer: True
Which of the following rules is INCORRECT about
cursor variables?
Answer: None of the choices.
Which of the following is the syntax to open a cursor
Which of the following describes weak REF
varial
CURSOR?
Answer: OPEN cursor_variable_name
FOR select_statement;
Answer: Associates with any query
Which of the following is the syntax to define a REF Restrictive, specifies a RETURN type, associates
only with type-compatible queries are description of
a . v_emp_sal employees.salary%TYPE;
Answer: Strong REF CURSOR BEGIN
Which of the following is INCORRECT about the query_emp('King', 'Steven', v_employee_id,
guidelines for cursor design? v_emp_sal);
Answer: Use column aliases in cursors for DBMS_OUTPUT.PUT_LINE('Employee ID ' ||
calculated columns fetched into records declared v_employee_id ||' earns '|| to_char(v_emp_sal,
with %COLUMNTYPE. '$999,999.00'));
This is a subset of an existing data type that may END;
place a constraint on its base type.
Answer: Subtype Which of the following stored procedure to create a
procedure to that will be used to display the
employee id and salary of Steven King?
Answer: CREATE OR REPLACE PROCEDURE
PROG-113A / ► Week 17: / ► Short Quiz 13 query_emp
Evaluate the following PL/SQL. (p_last_name IN employees.last_name%TYPE,
CREATE OR REPLACE PROCEDURE p_first_name IN employees.first_name%TYPE,
query_employee p_employee_id OUT employees.employee_id
(p_id IN employees.employee_id%TYPE, %TYPE,
p_name OUT employees.last_name%TYPE, p_salary OUT employees.salary%TYPE) IS
p_salary OUT employees.salary%TYPE) IS BEGIN
BEGIN SELECT last_name, salary INTO p_name, SELECT employee_id, salary INTO
p_salary p_employee_id, p_salary
FROM employeesWHERE employee_id = p_id; FROM employees
END query_employee WHERE last_name = p_last_name AND first_name
Answer: No error = p_first_name;
Evaluate the following PL/SQL. Which of the END query_emp;
following will line creates an error? What is the default parameter mode when no mode
CREATE OR REPLACE PROCEDURE is specified?
query_emp Answer: IN
(
p_department_id IN employees.department_id PROG-113A / ► Week 16: Creating Procedures / ►
%TYPE, Learning Activity 13
p_name OUT employees.last_name%TYPE, Procedure can be stored in the database as a schema
p_salary OUT employees.salary%TYPE object.
) Answer: True
IS
The PL/SQL code block helps modularize code by using:
BEGIN
Answer: All of the choices
SELECT last_name, salary, department_id INTO
Which of the following command is used to create a
p_name, p_salary, p_department_id
FROM employees stand-alone procedure that is stored in the Oracle
WHERE salary >= p_salary AND department_id = database?
p_department_id ; Answer: CREATE PROCEDURE
END query_emp; Which of the folllowing does NOT describes
Answer: Line 3 subprogram?
These are local variables declared in the parameter i. Compiled only once
list of a subprogram specification. ii. Stored in the database
Answer: Formal parameter iii. Do not return values
Given the answer in item , which of the iv. Can take parameters
folllowing stored procedure will display the v. Unnamed PL/SQL
employee id and salary of Steven King? blocks Answer: iii & v
Answer: DECLARE Which if the following is NOT a benefits of using
v_employee_id employees.employee_id%TYPE;
modular program constructs? fetched into records declared with %COLUMNTYPE.
Answer: None of the choices Answer: False
PROG-113A / ► Week 18: Designing PL/SQL / ► Short
PROG-113A / ► Week 18: Designing PL/SQL / ►
Quiz 14
Learning Activity 14
Which of the following is the syntax to open a cursor
varial
Which of the following rules is INCORRECT about
Answer: OPEN cursor_variable_name
cursor variables?
FOR select_statement; Answer: None of the choices.
Which of the following is the syntax to define a REF Which of the following describes weak REF
CURSOR type? CURSOR?
Answer: TYPE ref_type_name IS REF CURSOR Answer: Associates with any query
[RETURN return_type]; Restrictive, specifies a RETURN type, associates
Weak REF CURSOR is very flexible. only with type-compatible queries are description of
Answer: True a .
Evaluate the following. What will be the output? Answer: Strong REF CURSOR
DECLARE Which of the following is INCORRECT about the
SUBTYPE Accumulator IS NUMBER (4,2); guidelines for cursor design?
v_amount accumulator; Answer: Use column aliases in cursors for
v_num1 NUMBER; calculated columns fetched into records declared
v_num2 NUMBER; with %COLUMNTYPE.
v_num3 NUMBER; This is a subset of an existing data type that may
BEGIN place a constraint on its base type.
v_amount := 10.50; Answer: Subtype
v_num1 := 1;
PROG-113A / ► Week 15: Long Quiz / ► Long
v_num2 := 2;
Quiz 3 (30/30)
v_num3 := 3;
(Correction)
v_num1 := v_amount;
How do you test the output of a PL/SQL block?
v_num2 := v_num1 + v_amount; Answer: Use a predefined Oracle package and its
v_num2 := v_num2 - v_num3; procedure
dbms_output.put_line('Total is: ' || v_num2); Which of the folllowing statement describes
END; PL/SQL?
Answer: 18 Answer: PL/SQL is an Oracle proprietary,
Which of the following is the syntax to fetch from a procedural, 3GL programming language
cursor variable? Which of the following syntax to declare
Answer: FETCH cursor_variable_name INTO EXCEPTION named e_invalid_id?
variable_name1 Answer: e_invalid_id EXCEPTION;
[,variable_name2,. . .] | record_name; In PL/SQL Block Structure, which of the following
Fetch into a record when fetching from a cursor. are mandatory?
Answer: True Answer: BEGIN and END
Which of the following is the syntax to close a cursor? This is a type of cursor which is created and
Answer: CLOSE cursor_variable_name; managed internally by the Oracle server to process
This is a subset of an existing data type that may place a SQL statements
constraint on its base type. Answer: Implicit
Answer: Subtype PL/SQL stands for
Which of the following rules is INCORRECT about cursor
Answer: Procedural Language extension to SQL
Which of the following PL/SQL will execute
variables?
successfully?
Answer: None of the choices.
Answer: DECLARE
Use column aliases in cursors for calculated columns
v_salary INTEGER(20);
BEGIN
SELECT salary INTO v_salary FROM employees 114;
WHERE employee_id = 150; BEGIN
END; DELETE employees WHERE employee_id =
What is the last clause in trapping exceptions? v_employee_id;
Answer: WHEN OTHERS END;
PL/SQL Provides a block structure for Answer: The PL/SQL will delete employee number
executable units of . 114.
Answer: Code Which of the following does NOT describes
Evaluate the following PL/SQL. SELECT Statement in a PL/SQL.
DECLARE Answer: Queries must return only one column.
v_email VARCHAR(20); What are the three PL/SQL block types?
BEGIN Answer: Anonymous, Procedure, Function
SELECT email INTO v_email FROM What is the exception name when PL/SQL has an
EMPLOYEES WHERE email like 'D%'; internal problem
DBMS_OUTPUT.PUT_LINE ('Employees whose Answer: PROGRAM_ERROR
email address starts with letter D :' You have been tasked to update the database by
|| v_email); creating a PL/SQL to increase the salary of all IT
EXCEPTION Programmer employees by 100% of their existing
WHEN TOO_MANY_ROWS THEN salary. Which of the following will execute
DBMS_OUTPUT.PUT_LINE (' Your select successfully?
statement retrieved multiple rows.'); Answer: DECLARE
END; v_job_id employees.job_id%TYPE := 'IT_PROG';
Answer: The PL/SQL block will run successfully. BEGIN
Which of the folllowing is TRUE? UPDATE employees SET salary = salary * 2
Answer: SQL code are embedded within PL/SQL WHERE job_id = v_job_id;
statements END;
You can trap any error by including a What is the error trapping function that returns the
corresponding handler within the exception- numeric value of the error code?
handling section of the PL/SQL block. Answer: SQLCODE
Answer: True What is the exception name when single row
When an exception is user defined, the exception is SELECT returned no data.
raised . Answer: NO_DATA_FOUND
Answer: Explicitly Which of the following DOES NOT describes an
Evaluate the PL/SQL exception?
DECLARE Answer: Exception is a PL/SQL error that is raised
v_first_name VARCHAR2(50); before program execution.
v_last_name VARCHAR2(50); Evaluate the following PL/SQL.
v_salary INTEGER(20); DECLARE
BEGIN v_employee_id employees.employee_id%TYPE :=
SELECT first_name, last_name, salary INTO 114;
v_first_name, v_last_name, v_salary FROM BEGIN
employees WHERE department_id = 60; DELETE employees WHERE employee_id =
DBMS_OUTPUT.PUT_LINE('Firstname : '|| v_employee_id;
v_first_name); END;
DBMS_OUTPUT.PUT_LINE('Lastname : '|| Answer: The PL/SQL will delete employee number
v_last_name); 114.
DBMS_OUTPUT.PUT_LINE('Salary : '|| In the DECLARE section of the PL/SQL block,
v_salary); END; Answer: All of the choices
Answer: Error in Line 6. When an exception is predefined by Oracle
Evaluate the following PL/SQL. server, the exception is raised .
DECLARE Answer: Explicitly
v_employee_id employees.employee_id%TYPE := Which of the will display the Employee ID and
number of years in service with employee ID 150? Answer: Executable and exceptions section
Answer: DECLARE v_salaryemployees.salary What is the error trapping function that returns the
%TYPE := 10000; numeric value of the error code?
v_employee_idemployees.employee_id%TYPE := Answer: SQLCODE
150; What is the exception name when PL/SQL has an
v_years INTEGER(10); internal problem
BEGIN Answer: PROGRAM_ERROR
SELECT employee_id, ROUND((SYSDATE - Evaluate the following PL/SQL. At what line
hire_date) /365,0) INTO v_employee_id, v_years number is the error of the PL/SQL?
FROM employees WHERE employee_id = DECLARE
v_employee_id ; v_deptno NUMBER := 800;
DBMS_OUTPUT.PUT_LINE('Employee ID:' || e_invalid EXCEPTION;
v_employee_id); BEGIN
DBMS_OUTPUT.PUT_LINE('Number of years : ' DELETE FROM departments
|| v_years); WHERE department_id = v_deptno;
END; IF SQL % NOT_FOUND THEN
Actions are being performed when error occurs RAISE e_invalid;
during PL/SQL execution in the END IF;
Answer: EXCEPTION COMMIT;
You can use this procedure to issue user-defined EXCEPTION
error messages from stored subprograms. WHEN e_invalid THEN
Answer: RAISE_APPLICATION_ERROR DBMS_OUTPUT.PUT_LINE('No such department
id.');
END;
Answer: 7
PROG-113A / ► Week 14: Handling Exceptions / What is the last clause in trapping exceptions?
► Short Quiz 12 Answer: WHEN OTHERS
Complete the diagram in Trapping Non-Predefined
Evaluate the following PL/SQL. Oracle Server Errors.
DECLARE Answer: Declare, Associate, Reference
v_email VARCHAR(20);
BEGIN PROG-113A / ► Week 14: Handling Exceptions /
SELECT email INTO v_email FROM ► Learning Activity 12
EMPLOYEES WHERE email like 'D%';
DBMS_OUTPUT.PUT_LINE ('Employees whose You can use this procedure to issue user-defined
email address starts with letter D :' error messages from stored subprograms.
|| v_email); Answer: RAISE_APPLICATION_ERROR
EXCEPTION Which of the following syntax to declare
WHEN TOO_MANY_ROWS THEN EXCEPTION named e_invalid_id?
DBMS_OUTPUT.PUT_LINE (' Your select Answer: e_invalid_id EXCEPTION;
statement retrieved multiple rows.'); When an exception is predefined by Oracle
END; server, the exception is raised .
Answer: The PL/SQL block will run successfully. Answer: Explicitly
Which of the following DOES NOT describes an When an exception is user defined, the exception is
exception? raised .
Answer: Exception is a PL/SQL error that is raised Answer: Explicitly
before program execution. You can trap any error by including a
What is the exception name when single row corresponding handler within the exception-
SELECT returned no data. handling section of the PL/SQL block.
Answer: NO_DATA_FOUND Answer: True
RAISE_APPLICATION_ERROR is used in two
different places. These are .
PROG-113A / ► Week 13: Interacting with Oracle In the DECLARE section of the PL/SQL block
Server / ► Learning Activity 11 Answer: All of the choices
In PL/SQL Block Structure, which of the following
Which of the following does NOT describes are OPTIONAL?
SELECT Statement in a PL/SQL. Answer: None of the choices
Answer: Queries must return only one column. What are the three PL/SQL block types?
Evaluate the following PL/SQL. Answer: Anonymous, Procedure, Function
1 DECLARE How do you test the output of a PL/SQL
block?
2 v_employee_id employees.employee_id%TYPE Answer: Use a predefined Oracle package and its
:= 114; procedure
You want to display the name, salary and tax of
3 BEGIN employee #150. Which of the PL/SQL will execute
successfully? Note tax is computed as 2% of the
4 DELETE employees WHERE employee_id salary.
= v_employee_id; Answer: DECLARE
v_first_name VARCHAR2(50);
5 END; v_last_name VARCHAR2(50);
Answer: The PL/SQL will delete employee number v_salary INTEGER(20);
114. v_tax INTEGER(10);
Which of the following PL/SQL that will display BEGIN
the total number employees whose salary is 10000 SELECT first_name, last_name, salary, salary *
and above? 0.02 INTO v_first_name, v_last_name, v_salary,
Answer: DECLARE v_tax FROM employees WHERE employee_id
v_salary employees.salary%TYPE := 10000; = 150;
BEGIN DBMS_OUTPUT.PUT_LINE('Firstname : '||
SELECT COUNT(*) INTO v_salary FROM v_first_name);
employees WHERE salary >= v_salary; DBMS_OUTPUT.PUT_LINE('Lastname : '||
DBMS_OUTPUT.PUT_LINE(v_salary); v_last_name);
END; DBMS_OUTPUT.PUT_LINE('Salary : '||
This is a type of cursor which is created and v_salary); DBMS_OUTPUT.PUT_LINE('Tax : '||
managed internally by the Oracle server to process v_tax); END;
SQL statements Which of the folllowing statement describes
Answer: Implicit PL/SQL?
You have been tasked to update the database by Answer: PL/SQL is an Oracle proprietary,
creating a PL/SQL to increase the salary of all IT procedural, 3GL programming language
Programmer employees by twice of their existing
salary. Which of the following will execute PROG-113A / ► Week 12: Introduction to PLSQL / ►
successfully? Learning Activity 10
Answer: DECLARE PL/SQL stands for
v_job_id employees.job_id%TYPE := 'IT_PROG'; Answer: Procedural Language extension to SQL
BEGIN PL/SQL Provides a block structure for executable units
UPDATE employees SET salary = salary * 2
of .
WHERE job_id = v_job_id;
Answer: Code
END;
In PL/SQL Block Structure, which of the following are
mandatory?
PROG-113A / ► Week 12: Introduction to PLSQL
/ ► Short Quiz 10 Answer: BEGIN and END
Which of the following PL/SQL will execute successfully?
Which of the folllowing is TRUE? Answer: DECLARE
Answer: SQL code are embedded withing PL/SQL v_salary INTEGER(20);
statements BEGIN
SELECT salary INTO v_salary FROM employees WHERE
employee_id = 150;
END;
Actions are being performed when error occurs during PROG-113A / ► Week 11: Using Subqueries to Solve
PL/SQL execution in the Queries / ► Learning Activity 9
Answer: EXCEPTION Which of the following is INCORRECT?
Answer: Use single-row operators with multiple-row
subqueries
Which of the folllowing is required in a subquery?
PROG-113A / ► Week 11: Using Subqueries to Answer: SELECT
Solve Queries / ► Short Quiz 9 Which of the following is CORRECT about sub-queries?
Answer: Subquery execute before the main query
You want to display the department name the same executes.
with the location of the Purchasing department. Evaluate the SQL Command
Answer: SELECT department_name from SELECT job_id, job_title FROM jobs J WHERE INCLUDES
departments where location_id = (SELECT (SELECT * FROM employees WHERE J.job_id = e.job_id
location_id from departments where
);
department_name = 'Purchasing')
Answer: The SQL will return an error. Invalid
"INCLUDES" parameter.
Evaluate the SQL command
Evaluate the SQL command
SELECT employee_id, job_id, salary from
employees where salary < ALL (SELECT salary SELECT employee_id, salary from employees where
FROM employees WHERE job_id = salary = ANY (SELECT salary FROM employees WHERE
'FI_ACCOUNT') AND job_id = 'IT_PROG' job_id = 'IT_PROG') AND job_id = 'ST_CLERK'
Answer: This has no error. Answer: This has no error.

Question 1
You want to display all records in the database Complete
whose salary is above the salary of Alexander Mark 2.00 out of 2.00
Hunold.
Answer: SELECT * from employees WHERE
salary < (SELECT salary FROM employees
WHERE first_name = 'Alexander' AND last_name
= 'Hunold') Flag question

Evaluate the SQL command Question text


SELECT employee_id, last_name, first_name, You want to display all the job position titles whose salary is salary
Select one:
job_id FROM employees WHERE department_id = SELECT job_title FROM jobs WHERE min_salary
(SELECT max(department_id) FROM employees >= 5000 AND max_salary<= 10000
GROUP BY department_id) SELECT job_title FROM employees WHERE salary >= 5000 AND
Answer: This will return an error. Single-row SELECT employees_id, job_title FROM employees WHERE salary
subquery returns more than one row. SELECT job_title FROM jobs WHERE salary >= 5000 AND salary

You want to display all employee id, name,


hired date and salary who are hired after
employee 104 was hired.
Answer: SELECT employee_id, last_name,
hire_date, salary FROM employees WHERE
TO_NUMBER(TO_CHAR(hire_date, 'YYYY')) >
(SELECT TO_NUMBER(TO_CHAR(hire_date,
'YYYY')) FROM employees WHERE employee_id
Question 2
= 104) Complete
Mark 2.00 out of 2.00
c. The SQL command will display all records in the database
d. No records will be displayed

Flag question Question 5


Complete
Question text Mark 2.00 out of 2.00
What is the SQL command to count the number of records in the employees table?
Select one:
SELECT ALL FROM employees
SELECT * FROM employees;
SELECT COUNT(*) FROM employees
SELECT SUM(*) FROM employees; Flag question

Question text
You want to display all the employee id and the month an employe
Which SQL statement give the required output? Select one:
SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS
SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "H
Question 3 SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS
Complete SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') A
Mark 2.00 out of 2.00

Flag question

Question text
True or False. The AND, OR, NOT are comparison operators.
Select one:
True False

Question 6
Complete
Question 4 Mark 2.00 out of 2.00
Complete
Mark 2.00 out of 2.00

Flag question

Flag question
Question text
You want to generate the total salary per month of every departme
Question text Select one:
SELECTjob_title
Evaluate the following SQL command SELECT * FROM jobs WHERE department_id, salary FROM employees ORDER BY SUM
LIKE 'Manager%'
Select one: SELECT department_id, TOTAL(salary) FROM employees GROUP
The SQL command will produce an error. SELECT department_id, salary FROM employees GROUP BY SUM
The SQL command will display all employees with Manager position
d. SELECT department_id, SUM(salary) FROM employees GROUP
SELECTBYCONCATENATE(first_name,
department_id last_name)
AS Fullname FROM employees
SELECT CONCAT(first_name, last_name) FROM employees
SELECT CONCAT(first_name, last_name) AS Fullname FROM em
Question 7
Complete
Mark 2.00 out of 2.00

Question 9
Complete
Mark 0.00 out of 2.00
Flag question

Question text
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:
SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM Flag employees
question WHERE salary < 10,000 WHER
SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY"
Question text FROM employees WHERE salary < 10000 WHE
SELECT last_name, TO_INTEGER(salary, Display the first 5 letter in the surname of all the employees whose
$999,999.99) AS "MONTHLY SALARY" FROM Select one:
employees WHERE salary < 10000 WHERE last_name IN 'D%' SELECT SUBSTR(last_name,1,5), first_name FROM employees W
SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees
SELECT SUBSTR(last_name,1,5), WHERE
first_name salary
FROM < 10,000W
employees
= 'N'
SELECT SUBSTR(surname,1,5), first_name FROM employees WH
SELECT SUBSTR(surname,1,5), first_name FROM employees WH
SELECT SUBSTR(last_name,1,5), first_name FROM employees W

Question 10
Complete
Mark 2.00 out of 2.00

Flag question
Question 8
Complete
Question text Question text
Mark 2.00 out of 2.00
Display the lastname of every employee in the company. DisplayAustin Davidinwas
the output transferred
a single columntoand
Purchasing
label it asDepartment.
Fullname You
Format: JuanReyes Which of the following SQL command will satisfy the requirem
Select one: Select one:

Flag question
a. None of the choices
UPDATE first_name = ‘David’ AND last_name = ‘Austin’ FROM
The
employees
SQL command
SET department_id
will display employees
= 30 with department id 60 a
UPDATE department_id = 30 WHERE first_name The SQL command will give an incorrect output.
= ‘David’ AND last_name = ‘Austin’ The SQL command will display employees with department id 60 o
UPDATE employees WHERE department_id = 30 SET first_name = ‘David’ AND last_name = ‘Austin’
UPDATE employees SET department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’

Question 13
Complete
Mark 2.00 out of 2.00

Question 11
Complete
Mark 2.00 out of 2.00
Flag question

Question text
You want to display the employee's last name and date hired in yea
Select one:
Flag question SELECT last_name, hire_date FROM employees WHERE hire_da
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND
Question text hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR') AND salary >
John want to know how many employees receiving salary below 10,000.last_name, hire_date FROM employees WHERE hire_da
SELECT
What SQL command he need to run? Select one: TO_DATE('Jan-2000', 'Month-YYYY') AND
SELECT COUNT(*) FROM employees WHERE salary < 10000; hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') AND salary > 5
SELECT COUNT(salary) FROM employees WHERE salary < SELECT 10,000; last_name, hire_date FROM employees WHERE hire_da
SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND
SELECT salary FROM COUNT(employees)WHERE salary < 10000; hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon- YYYY') AND sala
SELECT last_name, hire_date FROM employees WHERE hire_da
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2006', 'YY

Question 12
Complete
Mark 2.00 out of 2.00

Question 14
Complete
Flag question Mark 2.00 out of 2.00
Question text
Evaluate the following SQL command
SELECT employee_id, salary, department_id FROM employees WHERE department_id IN (60,70)
Select one:
Flag question

a. The SQL command will produce an error. Question text


List all employees except for IT_PROG job id.
Select one:
SELECT *FROM employees EXCEPT JOB_ID != 'IT_PROG'
SELECT *FROM employees WHERE JOB_ID NOT IN ('IT_PROG')
SELECT *FROM employees WHERE JOB_ID <> 'IT_PROG'
Question 17
All of the choices
Complete
Mark 2.00 out of 2.00

d. SELECT * FROM employees SORT BY lastname ascending


Question 15 Flag question
Complete
Mark 2.00 out of 2.00 Question text
Display employee's name and id whose firstname starts with letter
Sort the output by department. Select one:
SELECT employee_id, first_name, last_name FROM employees O
SELECT employees FROM employee_id, first_name, last_name W
SELECT employee_id, first_name, last_name FROM employees W
Flag question
SELECT employee_id, first_name, last_name FROM employees W

Question text
Evaluate the following SQL command
SELECT employee_id, min_salary, max_salary FROM employees, departments WHERE salary>= 10000 && salary <= 20000
Select one:
The SQL will produce Cartesian Product
The SQL will display the employee id, department id and the minimum and maximum salary whose salary is between 10000 and
The SQL command will produce an error.
The SQL command will give an incorrect output.

Question 18
Complete
Question 16 Mark 2.00 out of 2.00
Complete
Mark 2.00 out of 2.00

Flag question

Flag question
Question text
You what to generate the average salary of all employees whose jo
Question text Select one:
SELECT
Display all the records in the employee table. Arrange the output AVERAGE(salary)
in by lastname FROM employees WHERE job_id = 'F
from A-Z order.
Select one: SELECT AVG(salary) FROM employees WHERE job_id = 'FI_ACC
SELECT * FROM employees SORT BY lastname
SELECT * FROM employees ORDER BY lastname
SELECT * FROM employees ORDER BY lastname AZ
c. SELECT AVE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
d. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';

d. SELECT employee_id, salary FROM employees WHERE salary)


e. SELECT employee_id, salary, salary * .30 FROM employees

Question 19 Question 21
Complete Complete
Mark 2.00 out of 2.00 Mark 2.00 out of 2.00

Flag question Flag question

Question text Question text


Display all location id between 1000 to 2000. Select one: Display the employee id, salary, number of years and the hiring dat
DISPLAY location_id FROM departments WHERE location_id Select one: UP TO 2000
LING 1000
DISPLAY location_id FROM departments WHERE location_id SELECT
BETWEEN employee_id,salary,
1000 TO 2000 hire_date, hire_date- SYSDATE /365
SELECT location_id FROM departments WHERE location_id IN SELECT employee_id,
1000 AND 2000 salary, hire_date, ROUND((SYSDATE - hire
SELECT employee_id,
SELECT location_id FROM departments WHERE location_id BETWEEN salary, hire_date, hire_date
1000 AND 2000
/365 FROM employees;

Question 22
Question 20 Complete
Complete Mark 2.00 out of 2.00
Mark 2.00 out of 2.00

Flag question
Flag question
Question text
Question text Display the employee's name, job title, job_id and the department n
What will be the SQL command if every employee will be givenSelect
a productivity
one: bonus which is equivalent to 3% of the monthly sala
Display the employee id, salary and the productivity bonus. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
Select one: FROM employees E
SELECT employee_id, salary, salary + (salary .03) JOIN jobs J ON E.job_id = J.job_id
FROM employees JOIN departments D ON E.department_id = D.department_id
SELECT employee_id, salary, salary * .03 FROM employees WHERE E.department_id = 100
SELECT employee_id, salary, salary * 1.03 FROM employeesSELECT 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
Select one:
JOIN jobs J ON E.department_id = D.department_id WHERE E.department_id = 100
SELECT E.employee_id, E.last_name, E.first_name, D.departmen
c. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J FROM employees E
INNER JOIN department D ON E.job_id = J.job_id INNER JOIN NATURAL
employeesJOIN
EONjobs J ON E.job_id == J.job_id
E.department_id NATURAL JOIN dep
D.department_id
WHERE E.department_id = 100 = D.department_id
ORDER BY "ANNUAL SALARY" DESC
d. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J WHERE D.location_id = 1700 AND D.department_name = 'Finance
NATURAL JOIN department D ON E.job_id = J.job_id NATURAL SELECT E.employee_id,
JOIN employees E ONE.last_name, E.first_name,
E.department_id D.departmen
= D.department_id
WHERE E.department_id = 100 FROM employees E
JOIN jobs J ON E.job_id = J.job_id JOINemployees E ON E.depart
WHERE D.location_id = 1700 AND D.department_name = 'Finance
SELECT E.employee_id, E.last_name, E.first_name, D.departmen
FROM employees E
JOIN jobs J ON E.job_id = J.job_id
JOIN departments D ON E.department_id = D.department_id
WHERE D.location_id = 1700 AND D.department_name = 'Finance
SELECT E.employee_id, E.last_name, E.first_name, D.departmen
FROM employees E
Question 23 OUTER JOIN jobs J ON E.job_id = J.job_id
Complete OUTER JOIN departments D ON E.department_id = D.department
Mark 2.00 out of 2.00 WHERE D.location_id = 1700 AND D.department_name = 'Finance

Flag question

Question text
In creating Joins,the NATURALJOIN and USING clauses are
Select one:
Mutually Inclusive
Limited to 2 relational tables
Opposite
Mutually Exclusive

Question 24
Complete
Mark 4.00 out of 4.00

Flag question

Question text PROG-113A-LAB-1812S / (47/50)► Week


Display employee id, lastname, firstname, department name, annual salary, location id of employees whose location id is 170
Sort the output in from highest to lowest salary. (4 POINTS)
10: Quarterly Examination / ► First Quarter
Exam

Question 1
Answer saved
Marked out of 1.00
Remove flag
Question
text Select one:
a. SELECT employee_id, salary, salary * .03 FROM
You can relate data to multiple tables using a foreign employees
key. b. SELECT employee_id, salary, salary * .30 FROM
Select one: employees
True c. SELECT employee_id, salary, salary * 1.03 FROM
False employees
d. SELECT employee_id, salary, salary + (salary .03)
Question 2 FROM employees
Answer saved e. SELECT employee_id, salary FROM employees
Marked out of 1.00 WHERE salary)
Remove flag
Question 5
Question text
Answer saved
Which of the following SELECT statement is the Marked out of 1.00
Flag question
correct report that will deduct 5 from ONHAND,
multiply 5 in WAREHOUSE, after getting the value on Question text
both ONHAND and WAREHOUSE add their data: as
shown below: ONHAND - 5 + 5 * WAREHOUSE You want to display the employee’s last name
Note that you have to force the Oracle to prioritize first whose salary is below 10,000 and whose lastname
the Subtraction over Multiplication. List only the starts with letter K.
column DESCRIPTION, ONHAND and
Which SQL statement give the required output
WAREHOUSE.
format of the salary?
Select one:
a. SELECT (ONHAND-5) + 5(* WAREHOUSE), Select one:
DESCRIPTION FROM PARTS; a. SELECT last_name, TO_CHAR(salary,
b. SELECT ONHAND-5 + 5 * WAREHOUSE, '$999,999.99') AS "MONTHLY SALARY" FROM
DESCRIPTION FROM PARTS; employees WHERE salary < 10000WHERE
c. SELECT (ONHAND-5) + 5 * WAREHOUSE, last_name LIKE ‘K%’
DESCRIPTION FROM PARTS; b. SELECT last_name, TO_NUMBER(salary,
d. SELECT ONHAND-5 + 5 (* WAREHOUSE), '$999,999.99') AS "MONTHLY SALARY" FROM
DESCRIPTION FROM PARTS; employees WHERE salary < 10,000WHERE
last_name = ‘K%’
Question 3 c. SELECT last_name, TO_INTEGER(salary,
Answer saved $999,999.99) AS "MONTHLY SALARY" FROM
Marked out of 1.00 employees WHERE salary < 10000 WHERE
Flag question
last_name IN 'K%'
Question text d. SELECT last_name, TO_INT(salary, '$999,999.99')
AS "MONTHLY SALARY" FROM employees WHERE
INSERT, DELETE, UPDATE are salary < 10,000 WHERE last_name STARTS 'K%'
commands
Question 6
Select one: Answer saved
a. DCL Marked out of 1.00
b. DML Remove flag
c. DDL
Question text
d. All of the choices
Which of the following is the correct report that will
Question 4 display the CLASS from table PARTS.
Answer saved
Marked out of 1.00 Select one:
Flag question
a. SELECT * CLASS FROM PARTS;
Question text b. SELECT CLASS AS CLASS FROM PARTS;
c. SELECT 'CLASS' FROM PARTS;
What will be the SQL command if every employee will d. SELECT CLASS FROM PARTS;
be given a productivity bonus which is equivalent to
3% of the monthly salary? Question 7
Display the employee id, salary and the productivity Answer saved
bonus. Marked out of 1.00
Remove flag
Question
text You want to display the employee's last name whose
salary is below 10,000 and whose lastname starts
Evaluate the following SQL command with letter D.
SELECT employee_id, salary, department_id FROM Which SQL statement give the required output format
employees WHERE department_id IN (60,70) of the salary?
Select one: Select one:
a. The SQL command will display employees with a. SELECT last_name, TO_INTEGER(salary,
department id 60 or 70. $999,999.99) AS "MONTHLY SALARY" FROM
b. The SQL command will give an incorrect output. employees WHERE salary < 10000 WHERE
c. The SQL command will produce an error. last_name IN 'D%'
d. The SQL command will display employees with b. SELECT last_name, TO_INT(salary, '$999,999.99')
department id 60 and 70. AS "MONTHLY SALARY" FROM employees WHERE
salary < 10,000 WHERE last_name STARTS 'D%'
Question 8
Answer saved c. SELECT last_name, TO_CHAR(salary,
Marked out of 1.00 '$999,999.99') AS "MONTHLY SALARY" FROM
Remove flag employees WHERE salary < 10000 WHERE
last_name LIKE 'D%'
Question text
d. SELECT last_name, TO_NUMBER(salary,
You what to generate the average salary of all '$999,999.99') AS "MONTHLY SALARY" FROM
employees whose job function is FI_ACCOUNT. employees WHERE salary < 10,000 WHERE
Which of the following SQL command will produce the last_name = ‘D%’
output.
Question 11
Select one: Answer saved
a. SELECT AVG(salary) FROM employees WHERE Marked out of 1.00
Flag question
job_id = 'FI_ACCOUNT';
b. SELECT AVE(salary) FROM employees WHERE Question text
job_id = 'FI_ACCOUNT';
c. SELECT AVERAGE(salary) FROM employees Which of the following will is the correct command to
WHERE job_id = 'FI_ACCOUNT'; create a role.
d. SELECT COUNT AVG(salary) FROM employees Select one:
WHERE job_id = 'FI_ACCOUNT'; a. CREATE ROLE gen_manager
b. None of the choices
Question 9
Answer saved
c. GRANT ROLE gen_manager
Marked out of 1.00 d. CREATE gen_manager ROLE
Remove flag
Question 12
Question text Answer saved
Marked out of 1.00
Evaluate the following SQL command Flag question
SELECT employee_id, min_salary, max_salary
FROM employees, departments WHERE Question text
salary>= 10000 && salary <= 20000 What is the SQL command to display the date of the
Select one: first employee that was hired?
a. The SQL will produce Cartesian Product Select one:
b. The SQL will display the employee id, department a. SELECT FIRST(hire_date) FROM employees;
id and the minimum and maximum salary whose b. SELECT hire_date FROM employees WHERE
salary is between 10000 and 20000. TO_CHAR(hire_date) = ‘FIRST’;
c. The SQL command will give an incorrect output. c. SELECT MIN(hire_date) FROM employees;
d. The SQL command will produce an error. d. SELECT hire_date FROM employees WHERE
FIRST(hire_date );
Question 10
Answer saved
Marked out of 1.00 Question 13
Flag question Answer saved
Marked out of 1.00
Question text Flag question

Question text
You want to display the employee id and the year TRUE OR FALSE.
when an employee was hired. A FOREIGN KEY is a field in one table that refers to
Which SQL statement give the required output? the PRIMARY KEY in another table.
Select one: Select one:
a. SELECT employee_id, YEAR(hire_date,'YYYY') True
FROM employees; False
b. SELECT employee_id, YEAR(hire_date') FROM
employees; Question 17
c. SELECT employee_id, Answer saved
Marked out of 1.00
TO_YEAR(hire_date,'YYYY') FROM employees; Flag question
d. SELECT employee_id,
TO_CHAR(hire_date,'YYYY') FROM employees; Question text

Question 14 INDEX is an example of


Answer saved privilege.
Marked out of 1.00
Remove flag Select one:
a. System
Question text b. None of the choices
Evaluate the following SQL command c. Object
SELECT employee_id, hire_date, department_name d. Data
FROM employees, departments
Question 18
WHERE departments.department_id = Answer saved
employees.department_id Marked out of 1.00
Flag question
Select one:
a. The SQL command will produce an error. Question text
b. The SQL command will give an incorrect output.
c. The SQL command should have ALIAS for the Ms. Ella what to generate the average salary of all
table to produce a correct output. employees whose job function is IT_PROG.
d. The SQL command will produce a correct output. Which of the following SQL command will produce the
output.
Question 15
Select one:
Answer saved
Marked out of 1.00 a. SELECT AVERAGE(salary) FROM employees
Remove flag WHERE job_id = 'IT_PROG';
b. SELECT AVE(salary) FROM employees WHERE
Question text job_id = 'IT_PROG';
Display all the records whose stock is below 20 and in c. SELECT AVG(salary) FROM employees WHERE
warehouse number 3. job_id = 'IT_PROG';
d. SELECT COUNT AVG(salary) FROM employees
Select one: WHERE job_id = 'IT_PROG';
a. SELECT * FROM parts WHERE onhand< 20 OR
warehouse = 3; Question 19
b. SELECT * FROM parts WHERE onhand> 20 OR Answer saved
Marked out of 1.00
warehouse = 3; Flag question
c. SELECT * FROM parts WHERE onhand< 20 AND
warehouse = 3; Question text
d. SELECT * FROM parts WHERE onhand<= 20 AND
warehouse = 3; A consists of a collection of DML
e. SELECT ALL FROM parts WHERE onhand< 20 statements that form a logical unit of work.
AND warehouse = 3; Select one:
f. SELECT ALL FROM parts WHERE onhand<= 20 a. All of the choices
AND warehouse = 3; b. Transaction
c. SQL command
Question 16
d. Database
Answer saved
Marked out of 1.00
Flag question Question 20
Answer saved
Question text Marked out of 1.00
Remove flag
and total outstanding balance on hand of every class
Question text in warehouse number 1&2.
Which of the following SQL command will generate
Which of the following SELECT statement is the the required output.
correct PL/SQL that will display all rows and
columns? Select one:
a. SELECT warehouse, class, count(partnum),
Select one: sum(onhand) GROUP BY warehouse,class HAVING
a. SELECT TABLE PARTS; warehouse = 1 or warehouse = 2 FROM parts;
b. SELECT FROM TABLE PARTS; b. SELECT warehouse, class, count(partnum),
c. SELECT * FROM PARTS; sum(onhand) GROUP BY warehouse,class WHERE
d. SELECT ALL FROM PARTS; warehouse = 1 or warehouse = 2 FROM parts;
c. SELECT warehouse, class, SUM(partnum),
Question 21 SUM(onhand) FROM parts GROUP BY
Answer saved warehouse,class HAVING warehouse = 1 AND
Marked out of 1.00
warehouse = 2;
Remove flag
d. SELECT warehouse, class, COUNT(partnum),
Question text SUM(onhand) FROM parts GROUP BY
warehouse,class HAVING warehouse = 1 OR
Display all the records in the employee table. Arrange warehouse = 2;
the output in by lastname from A-Z order.
Question 24
Select one: Answer saved
a. SELECT * FROM employees SORT BY lastname Marked out of 1.00
b. SELECT * FROM employees ORDER BY lastname Flag question
AZ
c. SELECT * FROM employees ORDER BY lastname Question text
d. SELECT * FROM employees SORT BY lastname John want to know how many employees receiving
ascending salary below 10,000.
What SQL command he need to run?
Question 22
Answer saved Select one:
Marked out of 1.00 a. SELECT COUNT(salary) FROM employees
Flag question
WHERE salary < 10,000;
Question text b. SELECT COUNT(*) FROM employees WHERE
salary < 10000;
Austin David was transferred to Purchasing c. SELECT salary FROM
Department. You are assigned to update the COUNT(employees)WHERE salary < 10000;
database. d. SELECT COUNT(emp_id) FROM employees
Which of the following SQL command will satisfy the WHERE salary <= 10000;
requirements?
Question 25
Select one: Answer saved
a. UPDATE first_name = ‘David’ AND last_name = Marked out of 1.00
‘Austin’ FROM employees SET department_id = 30 Flag question
b. UPDATE employees SET department_id = 30
WHERE first_name = ‘David’ AND last_name = Question text
‘Austin’ What privileges that manipulates the content of the
c. UPDATE department_id = 30 WHERE first_name = database objects.
‘David’ AND last_name = ‘Austin’
d. UPDATE employees WHERE department_id = 30 Select one:
SET first_name = ‘David’ AND last_name = ‘Austin’ a. Object Privileges
b. Connection Privileges
Question 23 c. Network Privileges
Answer saved d. System Privileges
Marked out of 1.00
Flag question
Question 26
Question text Answer saved
Marked out of 1.00
The General Manager request to the Database Remove flag
Administrator to generate the total number of parts Question text
Each Mon-YYYYY') AND hire_date <= TO_DATE('31-Dec-
row of data in a table can be uniquely identified 2002', 'DD-Mon-YYYY')AND salary ABOVE 5000;
by a b. SELECT last_name, hire_date FROM employees
WHERE hire_date >= TO_DATE('01-Jan-2002', 'DD-
Select one: Mon-RR') AND hire_date <= TO_DATE('31-Dec-
a. foreign key 2002', 'DD-Mon-RR') AND salary > 5000;
b. primary key c. SELECT last_name, hire_date FROM employees
c. local key WHERE hire_date >= TO_DATE('2000', 'YYYY') AND
d. relational key hire_date <= TO_DATE('2002', 'YYYY') OR salary >
e. index key 5000;
Question 27 d. SELECT last_name, hire_date FROM employees
Answer saved WHERE hire_date >= TO_DATE('Jan-2000', 'Month-
Marked out of 1.00 YYYY') AND hire_date <= TO_DATE('Dec-2002',
Flag question
'Month-‘YYYY') AND salary > 5,000;
Question text
Question 30
You want to display all the job position titles whose Answer saved
salary is salary from 5,000 to 12,000 arrange from Marked out of 1.00
Flag question
highest to lowest
Question text
Select one:
a. SELECT job_title FROM employees WHERE There was 10% price increase in the all the parts in
salary >= 5000 AND salary <= 10000 warehouse number 3. The Store Manager asked the
b. SELECT employees_id, job_title FROM employees Database Administrator to generate a report showing
WHERE salary >= 5000 AND salary <= 10000 the part number, the old and new price.
c. SELECT job_title FROM jobs WHERE salary >= Which of the following SQL statement would satisfy
5000 AND salary <= 10000 the requirement of the Store Manager.
d. SELECT job_title FROM jobs WHERE min_salary
>= 5000 AND max_salary<= 10000 Select one:
a. SELECT partnum, price, price * 0.1 FROM parts
Question 28 WHERE warehouse = 3
Answer saved b. SELECT partnum, price, price * 10% FROM parts
Marked out of 1.00 WHERE warehouse = 3
Remove flag
c. SELECT partnum, price, price * 1.1 FROM parts
Question text WHERE warehouse = 3
d. SELECT partnum, price, price * 1.10% FROM parts
Display all location id between 1000 to 2000. WHERE warehouse = 3
Select one: Question 31
a. DISPLAY location_id FROM departments WHERE Answer saved
location_id LING 1000 UP TO 2000 Marked out of 1.00
b. SELECT location_id FROM departments WHERE Remove flag
location_id IN 1000 AND 2000
Question text
c. DISPLAY location_id FROM departments WHERE
location_id BETWEEN 1000 TO 2000 You want to display the employee's last name and
d. SELECT location_id FROM departments WHERE date hired in year 2000 to2006 whose salary is above
location_id BETWEEN 1000 AND 2000 5000. Which SQL statement give the required output?

Question 29 Select one:


Answer saved a. SELECT last_name, hire_date FROM employees
Marked out of 1.00 WHERE hire_date>=
Flag question
TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND
Question text hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-
YYYY') AND salary ABOVE 5000;
You want to display the employee's last name and b. SELECT last_name, hire_date FROM employees
date hired in year 2002 whose salary is above 5000. WHERE hire_date>=
Which SQL statement give the required output? TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND
hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR')
Select one:
AND salary > 5000;
a. SELECT last_name, hire_date FROM employees
c. SELECT last_name, hire_date FROM employees
WHERE hire_date >= TO_DATE('01-Jan-2000', 'DD-
WHERE hire_date>=
TO_DATE('Jan-2000',
'Month-YYYY') AND Question 35
hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') Answer saved
AND salary > 5,000; Marked out of 1.00
d. SELECT last_name, hire_date FROM employees Remove flag
WHERE hire_date>= Question text
TO_DATE('2000', 'YYYY') AND hire_date<=
TO_DATE('2006', 'YYYY') OR salary > 5000; Evaluate the following SQL command
SELECT * FROM jobs WHERE job_title LIKE
Question 32 'Manager%'
Answer saved
Marked out of 1.00 Select one:
Remove flag a. The SQL command will display all records in the
Question text database
b. The SQL command will display all employees with
Which of the following SQL commands will display all Manager position
the stocks on hand from 10 to 30? c. No records will be displayed
d. The SQL command will produce an error.
Select one:
a. SELECT * FROM parts WHERE BETWEEN Question 36
onhand = 10 AND onhand = 30; Answer saved
b. SELECT * FROM parts WHERE onhand Marked out of 1.00
BETWEEN 10 to 30; Flag question
c. SELECT * FROM onhand WHERE parts Question text
BETWEEN onhand = 10 AND onhand = 30;
d. SELECT * FROM parts WHERE onhand Aldrin wants to know the highest salary in every
BETWEEN 10 AND 30; department. Which of the following SQL command will
e. SELECT * FROM parts WHERE BETWEEN display the required output?
onhand>=10 to onhand<=30;
Select one:
Question 33 a. SELECT department_id, HIGH(salary) FROM
Answer saved employees GROUP BY department_id AND salary;
Marked out of 1.00 b. SELECT department_id, HIGHEST(salary) FROM
Flag question employees GROUP BY salary;
Question text c. SELECT department_id, MAX(salary) FROM
employees GROUP BY department_id
ANSI SQL commands cannot be abbreviated. d. SELECT department_id, MAXIMUM(salary) FROM
employees GROUP BY department_id;
Select one:
True Question 37
False Answer saved
Marked out of 1.00
Question 34 Remove flag
Answer saved
Marked out of 1.00 Question text
Remove flag
You want to display all the employee id and the month
Question text an employee was hired.
Which SQL statement give the required output?
Display the lastname of every employee in the
company. Display the output in a single column and Select one:
label it as Fullname a. SELECT employee_id, hire_date,
Format: JuanReyes TO_MONTH(hire_date,'Month') AS "Hired Month",
job_id FROM employees
Select one: b. SELECT employee_id, hire_date,
a. SELECT CONCATENATE(first_name, last_name) TO_DATE(hire_date,'Month') AS "Hired Month",
AS Fullname FROM employees job_id FROM
b. None of the choices c. SELECT employee_id, hire_date,
c. SELECT CONCAT(first_name, last_name) FROM MONTH(hire_date,'Month') AS "Hired Month", job_id
employees FROM employees
d. SELECT CONCAT(first_name, last_name) AS d. SELECT employee_id, hire_date,
Fullname FROM employees TO_CHAR(hire_date,'Month') AS "Hired Month",
job_id FROM employees
Question 38 Marked out of 1.00
Flag question
Answer saved
Marked out of 1.00
Flag question
Question text

Question text Which of the following SQL command will display the
summary table showing the total quantity on hand per
Which of the following describes the command class.
below?
SELECT * FROM employees WHERE department = Select one:
60 FOR UPDATE a. SELECT class, TOTAL(onhand) AS "QTY ON
HAND" FROM parts GROUP BY class, onhand
Select one: b. SELECT class, onhand AS "QTY ON HAND"
a. Locks the rows in the EMPLOYEES table with FROM parts GROUP BY sum(onhand)
department id is 60. c. SELECT class, sum(onhand) AS "QTY ON HAND"
b. Unlock all records with department id = 60 FROM parts GROUP BY onhand
c. All users accessing the department id 60 can d. SELECT class, sum(onhand) AS "QTY ON HAND"
accept UPDATE command simultaneously. FROM parts GROUP BY class
d. Creates a temporary table with department = 60
Question 42
Question 39 Answer saved
Answer saved Marked out of 1.00
Marked out of 1.00 Remove flag
Flag question
Question text
Question text
Display the first 5 letter in the surname of all the
Display the employee id, number of years and the employees whose firstname starts with letter 'N'
hiring date of every employee in the company.
Select one:
Select one: a. SELECT SUBSTR(last_name,1,5), first_name
a. SELECT employee_id, hire_date, FROM employees WHERE SUBSTR(first_name,1,1)
ROUND((SYSDATE - hire_date),0 /365,0) FROM IN 'N'
employees; b. SELECT SUBSTR(last_name,1,5), first_name
b. SELECT employee_id, hire_date, FROM employees WHERE SUBSTR(first_name,1,1)
ROUND((SYSDATE - hire_date) /365,0) FROM = 'N'
employees; c. SELECT SUBSTR(surname,1,5), first_name FROM
c. SELECT employee_id, hire_date, hire_date /365 employees WHERE first_name = 'N'
FROM employees; d. SELECT SUBSTR(surname,1,5), first_name
d. SELECT employee_id, hire_date, hire_date- FROM employees WHERE SUBSTR(first_name,1,1)
SYSDATE /365 FROM employees; IN 'N'
e. SELECT SUBSTR(last_name,1,5), first_name
Question 40 FROM employees WHERE first_name IN 'N'
Answer saved
Marked out of 1.00 Question 43
Flag question
Answer saved
Marked out of 1.00
Question text Flag question
The DBA will create a new user name sales. Question text
Which of the following SQL command will perform the
creation? Display the employee id, salary, number of years and
the hiring date of every employee in the company.
Select one:
a. CREATE USER FR0M DB_USER SET Select one:
user=’sales’ password=NULL a. SELECT employee_id,salary, hire_date, hire_date-
b. None of the choices SYSDATE /365 FROM employees;
c. CREATE USERNAME sales SET PASSWORD b. SELECT employee_id, salary, hire_date, hire_date
default /365 FROM employees;
d. CREATE sales ACCESS 1234 c. SELECT employee_id, salary, hire_date,
e. CREATE USER sales IDENTIFIED BY 1234 ROUND((SYSDATE - hire_date) /365,0) FROM
employees;
Question 41
Answer saved Question 44
Answer saved WHERE first_name LIKE 'D%' and job_id =
Marked 'IT_PROG'
out of 1.00 d. SELECT employee_id, first_name, last_name
Flag question FROM employees WHERE first_name LIKE 'D%' and
Question text job_id = 'IT_PROG' ORDER BY department_id
True or False. The AND, OR, NOT are comparison
Question 47
operators. Answer saved
Marked out of 1.00
Select one: Flag question
True
False Question text

Question 45 TRUE OR FALSE.


Answer saved An owner has all the privileges on the object.
Marked out of 1.00
Flag question Select one:
True
Question text False
You want to display all the employee id and the month
Question 48
an employee was hired excluding employees whose Answer saved
job id is AD_VP. Which SQL statement give the Marked out of 1.00
required output? Flag question

Select one: Question text


a. SELECT employee_id, hire_date, You want to generate the total salary per month of
MONTH(hire_date,'Month') AS "Hired Month", every department in the company.
job_id FROM employees WHERE job_id EXCLUDE
Select one:
('AD_VP'); a. SELECT department_id, SUM(salary) FROM
b. SELECT employee_id, hire_date, employees GROUP BY department_id
TO_CHAR(hire_date,'Month') AS "Hired Month", b. SELECT department_id, salary FROM employees
job_id FROM employees WHERE job_id NOT IN ORDER BY SUM(salary)
('AD_VP'); c. SELECT department_id, salary FROM employees
c. SELECT employee_id, hire_date, GROUP BY SUM(salary) ORDER BY department_id
TO_MONTH(hire_date,'Month') AS "Hired Month", d. SELECT department_id, TOTAL(salary) FROM
job_id FROM employees WHERE job_id NOT employees GROUP BY department_id
('AD_VP');
d. SELECT employee_id, hire_date, Question 49
TO_DATE(hire_date,'Month') AS "Hired Month", Answer saved
job_id FROM employees WHERE job_id NOT = Marked out of 1.00
'AD_VP'; Flag question

Question text
Question 46
Answer saved Which of the following SQL commands will display all
Marked out of 1.00
Remove flag
stocks whose class is HW or AP.

Question text Select one:


a. SELECT * FROM parts WHERE IN (class = ‘HW’,
Display employee's name and id whose firstname class= ‘AP’);
starts with letter D and job id is IT_PROG. b. SELECT ALL FROM class WHERE parts IN =
Sort the output by department. (‘HW’, ‘AP’);
c. SELECT * FROM parts WHERE IN class ('HW',
Select one: 'AP');
a. SELECT employees FROM employee_id, d. SELECT ALL FROM parts WHERE IN class =
first_name, last_name WHERE first_name LIKE ‘D%’ (‘HW’, ‘AP’);
and job_id = ‘IT_PROG’ ORDER BY department_id e. SELECT * FROM parts WHERE class IN ('HW',
b. SELECT employee_id, first_name, last_name 'AP');
FROM employees WHERE job_id = 'IT_PROG' OR
first_name LIKE 'D%' and ORDER BY department_id Question 50
c. SELECT employee_id, first_name, last_name Answer saved
Marked out of 1.00
Flag question
b. Standard Query Language
Question text
What is the SQL command to count the number of records in the employees table?
Structured Query Language
Select one:
SELECT ALL FROM employees
Sequential
SELECT Query
* FROMLevel
employees;
SELECT COUNT(*) FROM employees
SELECT
Structure SUM(*)
Query FROM employees;
Level

Question 2
Correct

Mark 1.00 out of 1.00

BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2
Flag question

Question text

 My courses
Display the part number whose class is not HW,

 AG or SG.

Select one:
Started on Thursday, 19 December 2019, 3:2 1
a. SELECT partnum FROM parts WHERE class
State Finished NOT IN ('HW', 'AG', SG')
Completed on Thursday, 19 December 2019, 3:2 8
b. SELECT partnum FROM parts WHERE NOT IN
Time taken 6 mins 27 secs class ('HW', 'AG', SG')
Grade 6.00 out of 10.00 (60%)
c. SELECT partnum FROM parts WHERE class
Question 1 NOT IN = (‘HW’, AG’, SG’)
Incorrect

Mark 0.00 out of 1.00


d. None of the choices

Question 3
Incorrect

Mark 0.00 out of 1.00

Flag question

Question text

SQL stands for


Flag question
Select one:
Question text
a. Standard Question Language
Create an SQL command to display the name of SELECT LASTDAY(hire_date), hire_date FROM employees;
the parts, warehouse number, price and the
SELECT LAST(hire_date), hire_date FROM employees;
available stock on hand whose price is below
500. Arrange the list by warehouse number and employees;
by class.
d. SELECT LDAY(hire_date), hire_date FROM employees;
Select one: c. SELECT LAST_DAY(hire_date), hire_date FROM
a. SELECT partnum, description, warehouse,
onhand, price FROM parts ORDER BY warehouse, class WHERE price < 500;

SELECT partnum, description, warehouse, onhand, price WHERE price < 500 ORDER BY warehouse, class FROM parts
Question 5
SELECT partnum, description, warehouse, onhand, price ORDER BY warehouse, class ORDER BY warehouse, class FROM
Incorrect
SELECT partnum, description, warehouse, onhand, price FROM parts
Mark 0.00 ORDER BY warehouse, class WHERE 500 < price;
out of 1.00

SELECT partnum, description, warehouse, onhand, price FROM parts WHERE price < 500 ORDER BY warehouse, class;

Flag question

Question text

1. The two development environments of


Oracle are and .

Select one:
Question 4
Correct a. Oracle SQL Developer; ANSI SQL Web
Mark 1.00 out of 1.00

Oracle DB; SQL command line

Oracle SQL Developer; SQL command line

ANSI SQL Web; Oracle Net SQL


Flag question

Feedback
Question text
Your answer is incorrect.
Display the last day of the month and the hiring date when the employees are hired in the company.
Select one: Question 6
Correct
Mark 1.00 out of 1.00
c. SELECT ALL FROM parts WHERE IN class = (‘HW’, ‘AP’);

Flag question d. SELECT * FROM parts WHERE IN class ('HW',


'AP');
Question text
e. SELECT * FROM parts WHERE IN (class = ‘HW’, class= ‘AP’);
Display the first 3 letter in the first name of all the employees.
Select one:
Question 8
Correct
Mark 1.00 out of 1.00
SELECT SUBSTRING(first_name,1,3) FROM employees;

SELECT SUBSTRING(first_name,1,3) FROM employees;

SELECT SUBSTR(first_name,3) FROM employees;


Flag question

Question text

Display all employees whose job id contains the word 'AC


d. SELECT SUBSTR(first_name,1,3) FROM Select one:
employees;

Question 7
Correct a. SELECT * FROM EMPLOYEES WHERE job_id
Mark 1.00 out of 1.00
LIKE '%ACCOUNT%';

SELECT * FROM EMPLOYEES WHERE job_id LIKE '*ACCOUNT%

SELECT * FROM EMPLOYEES WHERE job_id LIKE '_ACCOUNT_


Flag question
SELECT * FROM EMPLOYEES WHERE job_id LIKE '_ACCOUNT%

Question text SELECT * FROM EMPLOYEES WHERE job_id LIKE '%*ACCOUN

Which of the following SQL commands will display all stocks whose class is HW or AP.
Select one:

SELECT * FROM parts WHERE class IN ('HW', 'AP');


Question 9
SELECT ALL FROM class WHERE parts IN = (‘HW’, ‘AP’); Correct

Mark 1.00 out of 1.00


Which of the following SELECT statement is the
correct report that will rename the column
DESCRIPTION to TITLE, PARTNUM to ID and
Flag question
ONHAND to STOCK?

Question text Select one:


a. SELECT DESCRIPTION RENAME AS TITLE,
Display employee's name and id whose firstname starts with letter
PARTNUM D and job
RENAME AS id
ID,isONHAND
SA_REP. Sort the output
RENAME by depa
AS STOCK FRO
Select one:
SELECT DESCRIPTION AS 'TITLE', PARTNUM AS 'ID', ONHAND

SELECT DESCRIPTION AS TITLE, PARTNUM AS ID, ONHAND A

SELECT employees FROM employee_id, first_name, last_name WHERE


SELECT first_nameNEW
DESCRIPTION LIKEAS
‘D%’ andPARTNUM
TITLE, job_id = ‘IT_PROG’
NEW AS ORD
ID, O
SELECT employee_id, first_name, last_name FROM employees WHERE job_id = 'IT_PROG' OR first_name LIKE 'D%' and

SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE 'D%' and job_id = 'IT_PROG' ORD
'IT_PROG' OR first_name LIKE 'D%' and ORDER BY department_id

SELECT employee_id, first_name, last_name FROM employees ORDER BY department_id WHERE first_name LIKE 'D%' a

BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2


 My courses


Started on Thursday, 19 December 2019, 3:30

State Finished

Question 10 Completed on Thursday, 19 December 2019, 3:32


Incorrect
Mark 0.00 out of 1.00 Time taken 2 mins 22 secs

Grade 8.00 out of 10.00 (80%)

Question 1
Correct
Flag question
Mark 1.00 out of 1.00

Question text
Flag question

Question text

List all the employee_id of all employees whose salary is 5000 and below and belong to department 60 or 100.
Select one:

b. SELECT * FROM parts WHERE BETWEEN onhand>=10 to onhand<=30;

c. SELECT * FROM parts WHERE onhand


BETWEEN 10 AND 30;

d. SELECT * FROM onhand WHERE parts BETWEEN onhand = 10 AND onhand = 30;

e. SELECT * FROM parts WHERE BETWEEN onhand = 10 AND onhand = 30;

a. SELECT employee_id,salary, department_id Question 3


Correct
FROM employees WHERE salary < 5000 AND department_id IN (60,100)
Mark 1.00 out of 1.00

SELECT employees FROM employee_id,salary, department_idWHERE salary < 5000 AND department_id IN (60,100)
SELECT LEN(last_name) FROM employees;
Question 2
SELECT
Correct employee_id FROM employee WHERE salary < 5000 AND department_id IN ('60,'100')
Mark 1.00 out of 1.00
SELECT LENGTH(last_name) FROM employees;
SELECT employee_id,salary, department_id FROM employeesFlag
WHERE salary < 5000 AND department_id IN (60 OR 10
question
SELECT TOTAL(last_name) FROM employees;

SELECT TOTALCHAR(last_name),LAST_NAME
Question text FROM EMPLOYE

Flag question Display the total number of characters of the last name
Select one:
Question 4
Question text Correct
Mark 1.00 out of 1.00
Which of the following SQL commands will display all the stocks on hand from 10 to 30?
Select one:

a. SELECT * FROM parts WHERE onhand BETWEEN 10 to 30; Flag question

Question text
Display the name, jobs id and salary of the all True
the employees whose department id is 100 and
False
salary is below 8000. Arrange the output by
salary in ascending order.
Question 6
Correct
Select one:
Mark 1.00 out of 1.00
SELECT name, salary FROM employees WHERE department_id = 100 AND salary < 8000 ORDER BY salary ASC

SELECT first_name, last_name, salary FROM employees ORDER BY salary WHERE department_id = 100 AND salary > 80

SELECT first_name, last_name, salary FROM employees WHERE salary < 8000 AND department_id = 100 AND ORDER B
Flag question
employees WHERE department_id = 100 AND salary < 8000 ORDER BY salary
Question text
e. SELECT name FROM employees WHERE salary
< 8000 AND department_id = 100 AND ORDER BY department_idEvery employee will get a bonus of 150% of his/her curren
Select one:
f. SELECT employees FROM first_name, last_name, salary WHERE department_id = 100 AND salary < 8000 ORDER BY sa

d. SELECT first_name, last_name, salary FROM


a. SELECT employee_id, salary, salary * 1.5 AS
Bonus FROM employees

SELECT employee_id, salary, salary * 150 AS "Bonus" FROM em

SELECT employee_id, salary, salary * 1.50% AS Bonus FROM e

SELECT employee_id, salary, salary * 150% AS "Bonus" FROM

Question 5
Incorrect
Question 7
Mark 0.00 out of 1.00
Correct
Mark 1.00 out of 1.00

Flag question

Flag question
Question text
Question text
Using Data Manipulation Language, you can ADD columns in the table.
Select one: Ronnie is the stockman in the warehouse of ATR Corporat
know the parts whose price is above 10000
and above. Which of the following SQL
command that Ronnie will run to generate
the list.
Question 9
f. SELECT ALL FROM parts ORDER BY price Correct
SELECT * FROM parts WHERE price > 10000; Mark 1.00 out of 1.00
g. SELECT * FROM parts SORT BY price DESC
SELECT * FROM parts WHERE price <= 10000;

c. SELECT * FROM parts WHERE price >= 10000;

SELECT parts FROM price WHERE price >= 10000; Flag question

SELECT ALL FROM parts WHERE price > ‘10000’; Question text

SELECT ALL FROM parts WHERE price < 10000; You can relate data to multiple tables using a foreign key.
Select one:
True False

Question 8
Correct
Mark 1.00 out of 1.00

Question 10
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

Flagto
Display all the records sorted by price from most expensive question
the cheapest parts.
Select one:
Question text

Which of the following is NOT a Data Manipulation Langu


SELECT * FROM parts SORT BY price
Select one:
SELECT ALL FROM parts SORT BY price HIGHEST

SELECT ALL FROM price SORT BY parts HIGHETS a. SELECT

b. CREATE

d. SELECT * FROM parts ORDER BY price DESC c. INSERT

d. DELETE
e. SELECT * FROM parts ORDER BY price
e. UPDATE Question 2
Correct

Mark 1.00 out of 1.00

BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2

Flag question

 Question text
 My courses
 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.
Started on Thursday, 19 December 2019, 3:35 P
Select one:
State Finished
a. SELECT employee_id, salary FROM employees
Completed on Thursday, 19 December 2019, 3:36WHERE salary *12 >= 100000 AND salary *12 <=
200000 ORDER BY salary desc
Time taken 1 min 35 secs
Grade b. SELECT employee_id, salary FROM employees
6.00 out of 10.00 (60%)
WHERE salary *12 >= 100000 AND salary *12 <=
Question 1 200000 ORDER BY salary
Correct

Mark 1.00 out of 1.00 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 >= 100000 AND salary <= 200000
Flag question
ORDER BY salary
Question text
Question 3
Which of the following SELECT statement is the Correct
correct PL/SQL that will display all rows and Mark 1.00 out of 1.00
columns?

Select one:

SELECT ALL FROM PARTS;


Flag question
SELECT FROM TABLE PARTS;
Question text
c. SELECT * FROM PARTS;
Display the employee id and the last name of
d. SELECT TABLE PARTS; 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: Question 5


d. SELECT DISTINCT WAREHOUSE AS "No. of available warehouse"
Correct FROM PARTS;
a. SELECT CONCAT(CONCAT(employee_id, ':'),
Mark 1.00 out of 1.00
last_name) AS Employee FROM employees

WHERE salary >= 5000 AND salary <= 10000

SELECT CONCAT(CONCAT(employee_id, ':'), last_name) AS Employee, salary FROM employees WHERE salary >= 5000 A
Flag question
SELECT CONCAT(employee_id, ':', last_name) AS Employee, salary FROM employees WHERE salary BETWEEN 5000 TO 1

SELECT CONCAT(employee_id,last_name) AS Employee FROMQuestion text WHERE salary >5000 AND 10000
employees

Display the montly salary of every employee. Round the s


Select one:

SELECT ROUND(salary *12 , 2) /12 FROM employees;

SELECT (ROUND(salary,2) )/12 FROM employees;


Question 4
Incorrect
employees;
Mark 0.00 out of 1.00

d. SELECT RND(salary,2)/12 FROM employees;


c. SELECT ROUND( (salary/12),2 ) FROM
e. SELECT RND( (salary/12),2 ) FROM employees;

Flag question

Question text

Which of the following SELECT statement is the correct report 6 will display the unique value for WAREHOUSE re
that
Question
Incorrect
Select one: Mark 0.00 out of 1.00

a. SELECT DISTINCT 'WAREHOUSE AS' "No. of Flag question

available warehouse" FROM PARTS;


Question text
b. SELECT DISTINCT WAREHOUSE AS No. of available warehouse FROM PARTS;
Which of the following SELECT statement is the correctrep
c. SELECT DISTINCT COLUMN WAREHOUSE AS "No. of available warehouse" FROM PARTS;
columns then rename the column as "NUMBER SELECT employee_id, job_id, salary FROM employees WHERE
TITLE". Note put space before and after the
SELECT employee_id, job_id, salary, MOD(salary, 3000) FROM
character literal string to avoid no spaces in the
report. SELECT employee_id, job_id, salary FROM employees WHERE
Select one:
a. SELECT (PARTNUM|| THAT BELONGS TO
||DESCRIPTION) AS "NUMBER TITLE" FROM PARTS;
SELECT (;PARTNUM'||' THAT BELONGS TO '||'DESCRIPTION;) AS "NUMBER TITLE" FROM PARTS;

SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS "NUMBER TITLE" FROM PARTS;

SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) ASQuestion


NUMBER 8 TITLE FROM PARTS;
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text
Question 7
Incorrect
Mark 0.00 out of 1.00 Which of the following SELECT statement is the correct PL
Select one:

Flag question
SELECT PRICE*0.10 FROM PARTS;
Question text
SELECT PRICE*10, DESCRIPTION, CLASS FROM PARTS;
Display all employees id and remainder of the his/her salary after it is divided by 3,000 for all employees with the jo
Select one: SELECT PRICE*0.10, DESCRIPTION, CLASS FROM PARTS;

SELECT PRICE*10+PRICE, DESCRIPTION, CLASS FROM PARTS;

a. SELECT employee_id, job_id, salary, salary/3000


FROM employees WHERE job_id = 'IT_PROG'

b. SELECT employee_id, job_id, salary, REM(salary/3000) FROMQuestion 9


employees WHERE job_id = 'IT_PROG'
Correct

Mark 1.00 out of 1.00


Flag question

Question text

Display the employee id, number of years and the hiring date of every employee in the company.
Select one:

SELECT partnum, description, warehouse FROM parts WHERE partnum = LIKE ‘K%’;

SELECT * FROM parts WHERE partnum LIKE 'K_';

SELECT partnumber, description, warehouse FROM parts WHERE partnum LIKE 'K*';

SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE '*K*';

SELECT * FROM parts WHERE partnum LIKE 'K%';

SELECT partnumber, description, warehouse FROM parts WHERE partnum = LIKE ‘K%’;

SELECT employee_id, hire_date, ROUND((SYSDATE - hire_date),0 /365,0) FROM employees;

SELECT employee_id, hire_date, hire_date- SYSDATE /365 FROM employees;

SELECT employee_id, hire_date, hire_date /365 FROM employees;


Started on Thursday, 19 December 2019, 3:38 PM
ROUND((SYSDATE - hire_date) /365,0) FROM
employees; State Finished
BL-PROG-3114-LAB-1922S
Completed on DATABASE)
PROGG(ORACLE Thursday, 19 December 2019, 3:40 PM
NCIIIP2
Time taken 1 min 41 secs
d. SELECT employee_id, hire_date,
 Grade 6.00 out of 10.00 (60%)
 My courses
Question 1

Incorrect

Question 10
Mark 0.00 out of 1.00
Correct
Mark 1.00 out of 1.00

a. SELECT partnum, description, warehouse


FROM parts WHERE partnum LIKE 'K%';
Flag question
Flag question

Question text
Question text index key

Using CREATE SQL Command, you can add new records in the
foreign table.
key
Select one:
relational key
True
Question 4
Incorrect
Mark 0.00 out of 1.00
False

Question 2
Correct
Mark 1.00 out of 1.00
Flag question

Question text

Flag question Which of the following SELECT statement is the correct PL


Select one:
Question text

ANSI SQL commands cannot be abbreviated. Select one:


a. SELECT DISTINCT CLASS, DISTINCT
WAREHOUSE FROM PARTS;
True
b. SELECT DISTINCT CLASS, WAREHOUSE FROM
False PARTS;

Question 3
c. SELECT DISTINCT CLASS AND WAREHOUSE FROM PARTS;
Correct
Mark 1.00 out of 1.00
d. SELECT DISTINCT CLASS AND DISTINCT WAREHOUSE FRO

Question 5
Flag question
Correct
Mark 1.00 out of 1.00
Question text

Each row of data in a table can be uniquely identified by a


Select one:
a. primary key Flag question

b. local key Question text


Incorrect
Display the first 5 letter in the surname of all the Mark 0.00 out of 1.00
employees whose firstname starts with letter 'D'

Select one:
SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN 'D'

SELECT SUBSTR(last_name,1,5), first_name FROM employees Flag


WHEREquestion
first_name IN 'D'

SELECT SUBSTR(last_name,1,5), first_name FROM employees Question


WHERE SUBSTR(first_name,1,1)
text IN 'D'

SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE


Which first_name = 'D' SELECT statement is the correctrep
of the following
Select one:
FROM employees WHERE SUBSTR(first_name,1,1)
= 'D'

a. SELECT (CLASS||PRICE) AS CLASS PRICE FROM


PARTS;
e. SELECT SUBSTR(last_name,1,5), first_name
SELECT ('CLASS'||'PRICE') AS "CLASS PRICE" FROM PARTS;

SELECT (CLASS||PRICE) CLASS PRICE FROM PARTS;


Question 6
Correct
SELECT (CLASS||PRICE) AS "CLASS PRICE" FROM PARTS;
Mark 1.00 out of 1.00

Question 8
Flag question Correct
Mark 1.00 out of 1.00

Question text

Which of the following is an Oracle Proprietary Commands


Select one:
Flag question

a. SQL *Plus Question text


Command use to display table structure Select one:

SQL

MySQL Plus
a. DESCRIBE
ANSI SQL
b. DISPLAY TABLE
Question 7
c. DISPLAY

d. DISPLAY STRUCTURE

b. SELECT 'CLASS' FROM PARTS;

c. SELECT CLASS FROM PARTS;

SELECT9 CLASS AS CLASS FROM PARTS;


d.Question
Incorrect
Mark 0.00 out of 1.00
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
Flag question
Select one:

Question text a. SELECT CONCAT(last_name, ',', first_name) AS


Fullname FROM employees
Which of the following is a Data Definition Language? b. SELECT CONCAT(last_name, first_name) FROM
Select one: employees
c. SELECT CONCAT(CONCAT(last_name, ','),
first_name) AS Fullname FROM employees;
a. GRANT
d. SELECT CONCAT(last_name, first_name) AS
b. REVOKE Fullname FROM employees;
The following are capabilities of SQL SELECT
MERGE Select one:
a. Grant priveledge, Add user
DROP
b. Projection, Selection, Join records
COMMIT c. Create records, Remove Table, Edit record

Question 10 d. Update, Delete, Add


Correct
Mark 1.00 out of 1.00
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:
Flag question a. SELECT (ONHAND||PRICE ||DESCRIPTION
FROM PARTS;
Question text b. SELECT PRICE, ONHAND, DESCRIPTION
PARTS;
Which of the following is the correct report that will display the CLASS from table PARTS.
Select one: c. SELECTONHAND,PRICE ,DESCRIPTION FROM
PARTS;
d. SELECTONHAND,PRICE DESCRIPTION FROM
a. SELECT * CLASS FROM PARTS; PARTS ORDER BY ONHAND;
d. SELECT department_id, HIGHEST(salary) FROM employees G
BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2
Question 2
Incorrect

Mark 0.00 out of 1.00



 My courses


Flag question

Started on Thursday, 19 December 2019, 7:24 PMQuestion text

State Finished
You want to display the employee id, date hired
Completed on Thursday, 19 December 2019, 7:27 PMof all employees whose hired date is September.

Time taken 3 mins 9 secs Which SQL statement give the required output?

Grade 16.00 out of 20.00 (80%)


Question 1
Correct

Mark 1.00 out of 1.00

Select one:

Flag question
a. SELECT employee_id,
Question text TO_DATE(hire_date, 'Month') AS "Hired Month"
FROM employees WHERE TO_DATE(hire_date,
Aldrin wants to know the highest salary in every 'MON') = 'SEP'
department. Which of the following SQL
command will display the required output? b. SELECT employee_id, hire_date,
TO_CHAR(hire_date, 'Month') AS "Hired
Select one:
Month" FROM employees WHERE
SELECT department_id, MAXIMUM(salary) FROM employees GROUP BY department_id;
TO_CHAR(hire_date, 'MON') = 'SEP'

SELECT department_id, HIGH(salary) FROM employees GROUPc.BY department_id


SELECT ANDhire_date,
employee_id, salary;
TO_CHAR(hire_date, 'Month') AS "Hired
c.
Month" FROM employees WHERE
employees GROUP BY department_id
TO_CHAR(hire_date, 'Month') =
SELECT department_id, MAX(salary) FROM TO_DATE('September')

d. SELECT employee_id, hire_date,


FROM employees WHERE TO_DATE(hire_date, d. SELECT last_name, TO_CHAR(salary,
'Month') = TO_DATE(‘09’) '$999,999.99') AS "MONTHLY SALARY" FROM
Question 3 employees WHERE salary < 10000
Correct
Mark 1.00 out of 1.00 Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text Flag question

Question
You want to display the employee's last name whose salary text10,000.
is below
Which SQL statement give the required output format of the salary?
You want to display the employee's id and formatted dat
Required output :
Which SQL statement give the required output? Required

Select one: Select one:


SELECT last_name, TO_INTEGER(salary,
$999,999.99) AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000

SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000

SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,
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;
Flag question
Question 5
Correct
Mark 1.00 out of 1.00
Question text

John want to know how many part items are there in ware
What SQL command he need to run? Select one:

Flag question

Question text SELECT COUNT(*) FROM parts WHERE


warehouse = 3;
You want to display all the employee id and the month an employee was hired excluding employees whose job id
Select one: SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;

SELECT * FROM COUNT(parts) WHERE warehouse = 3;

SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;

a. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month", job_id FROM employees WHERE job

Question 7
Correct
b. SELECT employee_id, hire_date, Mark 1.00 out of 1.00

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 (

d. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month", job_id FROM employees WHERE
Flag question

Question text

What is the SQL command to display the date of the first


Select one:

SELECT FIRST(hire_date) FROM employees;

Question 6 SELECT hire_date FROM employees WHERE FIRST(hire_date );


Correct

Mark 1.00 out of 1.00


The General
c. SELECT hire_date FROM employees WHERE TO_CHAR(hire_date) Manager request to the Database
= ‘FIRST’;
Administrator to generate the total salary per
month of every department in the company.
d. SELECT MIN(hire_date) FROM employees;
Select one:
Question 8
SELECT department_id, salary FROM employees GROUP BY SU
Correct
Mark 1.00 out of 1.00
SELECT department_id, TOTAL(salary) FROM employees GRO

Flag question
c. SELECT department_id, SUM(salary) FROM

Question text employees GROUP BY department_id

Aldrin wants to know the outstanding total balance ond.hand


SELECT
on department_id, salary FROM employees ORDER BY
every class per warehouse.
Select one:

Question 10
Correct
SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM
Mark parts GROUP
1.00 out of 1.00 BY warehouse, class

SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse), sum(class);

Flag question

c. SELECT warehouse, class, sum(onhand) FROM Question text


parts GROUP BY warehouse, class
There was 10% price increase in the all the parts in wareho
Which of the
d. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, following SQL statement would satisfy the re
class
Select one:

Question 9
Correct
Mark 1.00 out of 1.00

a. SELECT partnum, price, price * 0.1 FROM parts


Flag question
WHERE warehouse = 3

Question text b. SELECT partnum, price, price * 1.1 FROM parts


WHERE warehouse = 3
c. SELECT partnum, price, price * 1.10% FROM parts WHERE warehouse
Which = 3
of the following SQL command will
d. SELECT partnum, price, price * 10% FROM parts WHERE warehouse = 3
display all records with part number contains
the number 9?

a. SELECT * from parts WHERE partnum LIKE


Question 11
Incorrect '%9%'
Mark 0.00 out of 1.00
SELECT partnum FROM parts WHERE partnum
= ‘%9%’

SELECT partnum FROM parts WHERE partnum BETWEEN = ‘%

Flag question SELECT * FROM parts WHERE partnum IN ('%9%')

Question text

Display a summary table of the total quantity on hand above 50 very class per warehouse
Question 13
Select one:
Correct
Mark 1.00 out of 1.00

a. SELECT warehouse, class, sum(onhand) FROM


parts GROUP BY warehouseWHERE SUM(ONHAND) > 50

SELECT warehouse, class, sum(onhand) FROM parts WHERE SUM(ONHAND)


Flag question > 50

SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse,class


Question text HAVING SUM(ONHAND) > 50

SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse


You HAVING
want to display theSUM(ONHAND) > 50
last name and the year when an e
Which SQL statement give the required output? Select on

SELECT last_name, YEAR(hire_date,'YYYY') FROM employees W

Question 12
SELECT last_name, YEAR(hire_date') FROM employees WHERE
Correct
Mark 1.00 out of 1.00
SELECT last_name, TO_YEAR(hire_date,'YYYY') FROM employe

Flag question
d. SELECT last_name, TO_CHAR(hire_date,'YYYY')
Question text FROM employees WHERE job_id = ‘IT_PROG’;
Question 14 a. SELECT warehouse, class, COUNT(partnum),
Correct
Mark 1.00 out of 1.00 SUM(onhand) FROM parts GROUP BY warehouse,class HAVIN

SELECT warehouse, class, count(partnum), sum(onhand) GRO

SELECT warehouse, class, SUM(partnum), SUM(onhand) FROM

Flag question SELECT warehouse, class, count(partnum), sum(onhand) GRO

Question text

What will be the output of the following SQL?


SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP') AND (price > 200 AND p
Select one:

Invalid SQL command

Error Question 16
Correct
0 rows returned Mark 1.00 out of 1.00

d. 2 rows returned

e. 7 rows returned
Flag question
Question 15
Correct
Mark 1.00 out of 1.00 Question text

You want to display the employee's last name and date hi


Which SQL statement give the required output? Select on

Flag question

Question text
SELECT last_name, hire_date FROM employees WHERE hire_d
The General Manager request to the Database Administrator to generate the total number of parts and total outsta
SELECT
Which of the following SQL command will generate the last_name,
required output.hire_date FROM employees WHERE hire_d
Select one:
TO_DATE('31-Dec-2002', 'DD-Mon-YYYY')AND Question text
salary ABOVE 5000;
You want to display the employee's last name
c. SELECT last_name, hire_date FROM employees WHERE hire_date
hired >= TO_DATE('Jan-2000',
from year 2000 to 2002. 'Month-YYYY') AND hire_d

Which SQL statement give the required output?


Select one:
a. SELECT last_name, hire_date FROM employees
d. SELECT last_name, hire_date FROM employees
WHERE hire_date>= TO_DATE('2000', 'YYYY') AND hire_date<
WHERE hire_date >= TO_DATE('01-Jan-2002', 'DD-Mon-RR') AND hire_date <= TO_DATE('31- Dec-2002', 'DD-Mon-RR
SELECT last_name, hire_date FROM employees WHERE hire_d

SELECT last_name, hire_date FROM employees WHERE hire_d


Question 17
SELECT last_name, hire_date FROM employees WHERE hire_d
Correct
Mark 1.00 out of 1.00

Flag question

Question text

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:
Question 19
Incorrect
Mark 0.00 out of 1.00
a. 85

b. 178

c. 44
Flag question

d. 137
Question text
Question 18
Incorrect Display the warehouse number, class, highest price & low
Mark 0.00 out of 1.00 Sort the output by warehouse number. Select one:

Flag question
a. SELECT warehouse, class, MAX(price), Select one:
MIN(PRICE), SUM(onhand) a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "M
FROM parts
GROUP BY warehouse, class ORDER BY warehouse; WHERE class = 'AP'

SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)


FROM parts WHERE class = 'AP'
b. SELECT last_name, TO_CHAR(salary,
GROUP BY warehouse, class ORDER BY warehouse;
'$999,999.99') AS "MONTHLY SALARY" FROM
SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onhand)
employees WHERE salary < 10000WHERE last_name LIKE ‘K%
FROM parts
GROUP BY warehouse WHERE class = 'AP' c. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONT
ORDER BY warehouse, class;
d. SELECT last_name, TO_INTEGER(salary,
SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)
$999,999.99) AS "MONTHLY SALARY" FROM
FROM parts WHERE class = 'AP' employees WHERE salary < 10000 WHERE last_name IN 'K%'
GROUP BY warehouse, class, price ORDER BY warehouse, class

BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2


 My courses
Question 20

Correct
Mark 1.00 out of 1.00

Started on Thursday, 19 December 2019, 7:31 PM

State Finished
Flag question
Completed on Thursday, 19 December 2019, 7:35 PM
Question text Time taken 3 mins 55 secs

You want to display the employee’s last name whose salary is below 10,000 and whose
Grade lastname starts
19.00 out with letter
of 20.00 (95%) K.
Which SQL statement give the required output format of the salary?
Question 1
Correct

Mark 1.00 out of 1.00


Flag question
Flag question

Question text Question text

John want
You want to display the employee id, date hired of all employees to know
whose how
hired many
date employees receiving salary
is September.
Which SQL statement give the required output? Select one:

SELECT salary FROM COUNT(employees)WHERE salary < 100

SELECT COUNT(salary) FROM employees WHERE salary < 10,0

SELECT COUNT(emp_id) FROM employees WHERE salary <=

salary < 10000;


Select one:

SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees WHERE TO_CHAR(h
d. SELECT COUNT(*) FROM employees WHERE
SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees WHERE TO_CHAR(h

SELECT employee_id, hire_date, TO_CHAR(hire_date, 'Month') AS "Hired Month" FROM employees WHERE TO_DATE(hi
Question 3
SELECT employee_id, hire_date, TO_DATE(hire_date, 'Month')Correct
AS "Hired Month" FROM employees WHERE TO_DATE(hir
Mark 1.00 out of 1.00

Flag question

Question text

What will be the output of the following SQL?


SELECT * FROM parts WHERE (warehouse = 1 or warehou
Select one:

Question 2
Correct 7 rows returned
Mark 1.00 out of 1.00
Error
c. 0 rows returned What is the SQL command to display the date
of the first employee that was hired?
d. Invalid SQL command
Select one:
e. 2 rows returned
a. SELECT MIN(hire_date) FROM employees;
Question 4
Correct SELECT FIRST(hire_date) FROM employees;
Mark 1.00 out of 1.00
SELECT hire_date FROM employees WHERE FIRST(hire_date );

SELECT hire_date FROM employees WHERE TO_CHAR(hire_da

Flag question

Question 6
Question text Correct
Mark 1.00 out of 1.00
Ms. Ella what to generate the average salary of all employees whose job function is IT_PROG.
Which of the following SQL command will produce the output.
Select one:

Flag question

a. SELECT AVG(salary) FROM employees WHERE Question text

job_id = 'IT_PROG'; John want to know how many part items are there in ware
What SQL command he need to run? Select one:
SELECT AVE(salary) FROM employees WHERE job_id = 'IT_PROG';

SELECT AVERAGE(salary) FROM employees WHERE job_id = 'IT_PROG';

SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'IT_PROG';


SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;

SELECT * FROM COUNT(parts) WHERE warehouse = 3;

SELECT COUNT(*) FROM parts WHERE warehouse = 3;


Question 5
Correct SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;
Mark 1.00 out of 1.00

Flag question
Question 7
Correct
Question text
Mark 1.00 out of 1.00
WHERE class = 'AP'
GROUP BY warehouse, class ORDER BY warehouse;

Flag question
SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhan
FROM parts WHERE class = 'AP'
GROUP BY warehouse, class, price ORDER BY warehouse, clas
Question text
SELECT warehouse, class, HIGH(price), LOW(PRICE), SUM(onha
Aldrin wants to know the highest salary in every department. Which of the following SQL command will display the
FROM parts
Select one:
GROUP BY warehouse WHERE class = 'AP'
ORDER BY warehouse, class;

SELECT warehouse, class, MAX(price), MIN(PRICE), SUM(onha


SELECT department_id, HIGHEST(salary) FROM employeesFROM
GROUPparts
BY salary;
GROUP BY warehouse, class ORDER BY warehouse; WHERE cl
SELECT department_id, MAXIMUM(salary) FROM employees GROUP BY department_id;

SELECT department_id, HIGH(salary) FROM employees GROUP BY department_id AND salary;

d.
employees GROUP BY department_id

SELECT department_id, MAX(salary) FROM

Question 8
Correct Question 9
Mark 1.00 out of 1.00 Correct
Mark 1.00 out of 1.00

Flag question
Flag question

Question text
Question text
Display the warehouse number, class, highest price & lowest price, total on hand balance whose class is AP.
Sort the output by warehouse number. Select one: You want to display the employee id and the month an em
Which SQL statement give the required output? Required

a. SELECT warehouse, class, MAX(price), MIN(PRICE), sum(onhand)


FROM parts
Select one: c. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "H

SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;hire_date, TO_CHAR(hire_date,'Month


d. SELECT employee_id,

SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM employees;

SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month" FROM employees;

SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM employees;

Question 11
Correct
Mark 1.00 out of 1.00

Question 10 Flag question


Correct
Mark 1.00 out of 1.00
Question text

You want to display the employee's last name hired from


Which SQL statement give the required output? Select on

Flag question

Question text
SELECT last_name, hire_date FROM employees WHERE hire_d
You want to display all the employee id and the month an employee was hired excluding employees whose job id
SELECT last_name, hire_date FROM employees WHERE hire_d
Select one:
SELECT last_name, hire_date FROM employees WHERE hire_d

SELECT last_name, hire_date FROM employees WHERE hire_d

SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month", job_id FROM employees WHERE job_id
SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month", job_id FROM employees WHERE job
Question 12 TO_DATE('31-Dec-2002', 'DD-Mon-YYYY')AND
Correct salary ABOVE 5000;
Mark 1.00 out of 1.00

SELECT last_name, hire_date FROM employees WHERE hire_d

SELECT last_name, hire_date FROM employees WHERE hire_d

SELECT last_name, hire_date FROM employees WHERE hire_d


Flag question

Question text

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. 137

b. 178 Question 14
Correct
Mark 1.00 out of 1.00
c. 85

d. 44

Question 13
Correct Flag question
Mark 1.00 out of 1.00

Question text

You want to display the employee's last name whose sala


Which SQL statement give the required output format of
Flag question Required output :

Question text

You want to display the employee's last name and date hired in year 2002 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('01-Jan-2000', 'DD-Mon-YYYYY') AN
a. SELECT warehouse, class, sum(onhand) FROM
parts WHERE SUM(ONHAND) > 50

SELECT warehouse, class, sum(onhand) FROM parts GROUP B

SELECT warehouse, class, sum(onhand) FROM parts GROUP B

SELECT warehouse, class, sum(onhand) FROM parts GROUP B

Select one:
SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000
Question 16
SELECT last_name, TO_INTEGER(salary, Correct
Mark 1.00 out of 1.00
$999,999.99) AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000

c.
'$999,999.99') AS "MONTHLY SALARY" FROM
employees WHERE salary < 10000 Flag question
SELECT last_name, TO_CHAR(salary,
d. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10
Question text

The General Manager request to the Database Administra


Select one:

Question 15
Incorrect SELECT department_id, SUM(salary) FROM employees GROUP
Mark 0.00 out of 1.00
SELECT department_id, TOTAL(salary) FROM employees GROU

SELECT department_id, salary FROM employees GROUP BY SU

SELECT department_id, salary FROM employees ORDER BY SU


Flag question

Question text

Display a summary table of the total quantity on hand above 50 very class per warehouse
Select one:

Question 17
Correct
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following SQL command will display the summary table showing the total quantity on hand per clas
Question 19
Select one:
Correct
Mark 1.00 out of 1.00

b. SELECT employee_id, YEAR(hire_date,'YYYY') FROM employees;


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 Flag
GROUP BY onhand
question
TO_CHAR(hire_date,'YYYY')
SELECT employee_id, FROM employees;
SELECT class, onhand AS "QTY ON HAND" FROM parts GROUP BY sum(onhand)
d. SELECT employee_id, TO_YEAR(hire_date,'YYYY') FROM employees;
Question text
SELECT class, sum(onhand) AS "QTY ON HAND" FROM parts GROUP BY class
Aldrin wants to know the outstanding total balance on ha
Select one:

SELECT warehouse, class, onhand FROM parts GROUP BY war

Question 18 SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FRO


Correct
Mark 1.00 out of 1.00 SELECT warehouse, class, sum(onhand) FROM parts GROUP B

SELECT warehouse, class, onhand FROM parts GROUP BYsum

Flag question

Question text

You want to display the employee id and the year when an employee was hired.
Question 20
Which SQL statement give the required output? Select one:
Correct
Mark 1.00 out of 1.00

a. SELECT employee_id, YEAR(hire_date') FROM employees;

Flag question
Question text Time taken1 min 44 secs

You want to display the employee’s last name Grade6.00 out of 10.00 (60%)
whose salary is below 10,000 and whose lastname
Question 1
starts with letter K.
Incorrect
Which SQL statement give the required output Mark 0.00 out of 1.00

format of the salary?


Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10

b. Flag question
'$999,999.99') AS "MONTHLY SALARY" FROM Question text
employees WHERE salary < 10000WHERE last_name LIKE ‘K%’
Create a SQL command to update the employees table
SELECT last_name, TO_CHAR(salary, Employee id : 200 Name : Mr. Gary Park Date hired : July
c. SELECT last_name, TO_INTEGER(salary,
$999,999.99) AS "MONTHLY SALARY" FROM Department of assignment : 60
employees WHERE salary < 10000 WHERE last_name IN 'K%' Reporting to manager : 103 Select one:

d. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000 W

a. INSERT INTO employees (employee_id,first_name,last_name


VALUES (200,'Gary','Park',TO_DATE('Jul 1, 2017',
'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60)

b. INSERT FROM employees



My courses VALUES (200,'Gary','Park',TO_DATE('Jul 1, 2017', 'MON DD, YY

 c. INSERT FROM employees
 VALUES (200,'Gary','Park', TO_CHAR('Jul 1, 2017',

Started on Thursday, 19 December 2019, 7:4 9 'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60)
State Finished
d. INSERT INTO employees
Completed on Thursday, 19 December 2019, 7:5 1 (employee_id,first_name,last_name,hire_date,job_i

d,salary,manager_id,department_id)
VALUES (200,'Gary','Park', TO_CHAR('Jul 1, 2017', UPDATE salary FROM employees SET salary + 500 where TO_
'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60) TO_YEAR(hire_date,'YYYY') >= 10

Question 2 UPDATE salary= salary + 500 where TO_DATE(sysdate,'YYYY')


Correct
TO_DATE(hire_date,'YYYY') >= 10
Mark 1.00 out of 1.00

UPDATE employees SET salary = salary + 500 where TO_CHAR


TO_CHAR(hire_date,'YYYY') >= 10

UPDATE employees SET salary = salary + 500 where YEAR(sys


Flag question

Question text

Remove the Shareholder Services department in the department table


Select one:

Question 4
Correct
DELETE * FROM departments_name HAVING department_name
MarkLIKE '%Shareholder
1.00 out of 1.00 Services%'

DELETE departments FROM departments_name WHERE department_name = ‘%Shareholder Services%’


None of the choices

DELETE FROM departments WHERE department_name = ‘Shareholder Services’


Flag question

Question text

Given the SQL command SELECT employees.first_name, em


employees.salary,departments.department_name FROM em
WHERE employees.department_id = departments.departm
Question 3 Which of the following describes the SQL command?
Correct
Mark 1.00 out of 1.00
Select one:

Flag question

Question text List of employees name, salary and department name

Add a 500 pesos increase in salary of all employees who have rendered
Cartesian Product services 10 years and above.
Select one:
Results to invalid SQL command
d. Results to invalid relational operator

e. Display a full outer join


Flag question
Question 5
Incorrect
Mark 0.00 out of 1.00 Question text

Display all the employee id, names of employees


,job id and department nameof all employees of the Finan
Select one:

Flag question

a. SELECT first_name, last_name, job_id,


Question text
department_name FROM employees JOIN department ON (d
Update the Purchasing department name to Procurement.
SELECT And this will be A.last_name,
A.first_name, managed by A.job_id,
the Manager of Administra
B.department_nam
Select one:
SELECT A.first_name, A.last_name, A.job_id, B.department_nam
All of the choices

UPDATE FROM departments SET department_name = 'Procurement' AND manager_id = 200 WHERE department_nam

UPDATE departments SET department_name = 'Procurement', manager_id = 200 WHERE department_name = 'Purchas

UPDATE * FROM departments SET department_name = 'Procurement', SET manager_id = 200 HAVING department_na

UPDATE departments_name FROM departments SET department_name = 'Procurement', SET manager_id = 200 WHER

Question 7
Correct
Mark 1.00 out of 1.00

Flag question
Question 6
Incorrect
Question text
Mark 0.00 out of 1.00
A new department name Training with department id 300
This will be managed by a Manager with ID of
203 and will located at location id 2400.

Create a SQL command to update the


information in the department table. Question 9
Correct
Select one:
Mark 1.00 out of 1.00
d. INSERT FROM jobs(jobs_id, job_title, min_salary, max_salary) VALUES ('JAVA_DEV', 'Java Developer', 7000, 8000
INSERT INTO departments SET department_id
= 300, department_name = 'Training', manager_id = 203, location_id = 2400

INSERT FROM departments(department_id, department_name, manager_id, location_id) VALUES (300, 'Training', 203, 2

INSERT INTO departments VALUES (300, 'Training', 203, 2400)Flag question

INSERT * FROM departments VALUES (300, 'Training', 203, 2400)


Question text

Create a SQL command to add a new position Database A


Select one:

INSERT * FROM jobs VALUES ('DB_ADMIN', 'Database Admini


Question 8
Correct
Mark 1.00 out of 1.00
INSERT FROM jobs VALUES ('DB_ADMIN', 'Database Administ

INSERT FROM jobs SET job_id = 'DB_ADMIN', job_title= 'Data

INSERT INTO jobs VALUES ('DB_ADMIN', 'Database Administr

Flag question

Question text

Create a SQL command to add a new position Java Developer with job id of JAVA_DEV whose salary ranges from 7
Select one:
Question 10
Incorrect
Mark 0.00 out of 1.00

INSERT FROM jobs SET jobs_id = ‘JAVA_DEV’, job_title = ‘Java Developer’ , min_salary =7000 , max_salary= 8000

INSERT * INTO jobs VALUES (JAVA_DEV, Java Developer, 7000, 8000)


Flag question
INSERT INTO jobs VALUES ('JAVA_DEV', 'Java Developer', 7000, 8000)

Question text
Update the Treasury department to Cash
department. And this will be managed by the
Manager of Finance department.
Flag question
Select one:
a. UPDATE FROM departments SET Question text
department_name = 'Procurement', SET manager_id = 100 HAVING
Create adepartment_name
SQL command to =add
'Treasury'
a new position Java Develo
UPDATE department_name = 'Procurement', manager_id = 100 FROM departmentsWHERE
Select one: department_name = 'Treas

UPDATE department_name = 'Procurement' AND manager_id = 100FROM departments WHERE department_name = '

UPDATE departments SET department_name = 'Procurement', manager_id = 100 WHERE department_name = 'Treasur
INSERT FROM jobs SET jobs_id = ‘JAVA_DEV’, job_title = ‘Java

INSERT * INTO jobs VALUES (JAVA_DEV, Java Developer, 7000

Developer', 7000, 8000)

d. INSERT FROM jobs(jobs_id, job_title, min_salary, max_salary

c. INSERT INTO jobs VALUES ('JAVA_DEV', 'Java

BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2
Question 2
Correct

 My courses Mark 1.00 out of 1.00


Started on Thursday, 19 December 2019, 7:54 PM


Flag question
State Finished
Question text
Completed on Thursday, 19 December 2019, 7:55 PM
A new department name Training with
Time taken 1 min 16 secs
department id 300 was created in the company.
Grade 9.00 out of 10.00 (90%) This will be managed by a Manager with ID of
203 and will located at location id 2400.
Question 1
Correct Create a SQL command to update the
Mark 1.00 out of 1.00 information in the department table.
Select one:
INSERT * FROM departments VALUES (300, 'Training', 203, 2400)
Question 4
Correct
INSERT INTO departments SET department_id Mark 1.00 out of 1.00

= 300, department_name = 'Training', manager_id = 203, location_id = 2400

INSERT FROM departments(department_id, department_name, manager_id, location_id) VALUES (300, 'Training', 203, 2

Flag question

Question text

Given the SQL command SELECT employees.first_name, em


d. INSERT INTO departments VALUES (300,
employees.salary,departments.department_name FROM em
'Training', 203, 2400) WHERE employees.department_id = departments.departm
Which of the following describes the SQL command?
Question 3
Correct Select one:
Mark 1.00 out of 1.00

Flag question

Results to invalid relational operator


Question text
Cartesian Product
Display the manager id and employee id of every employee
Select one: Results to invalid SQL command

Display a full outer join


SELECT E.employee_id, D.manager_id FROM employees E FULL JOIN departments D WHERE E.department_id = D.depa
e. List of employees name, salary and
SELECT E.employee_id, D.manager_id FROM employees E INNER JOIN departments D USING E.department_id = D.dep
department name
SELECT E.employee_id, D.manager_id FROM employees E OUTER JOIN departments D ON E.department_id = D.depart
Question 5
Correct
Mark 1.00 out of 1.00

Flag question

d. SELECT E.employee_id, D.manager_id FROM


Question text
employees E JOIN departments D ON E.department_id = D.department_id
Remove all Manager positions in the department table.
Select one: Incorrect
Mark 0.00 out of 1.00
DELETE * FROM jobs WHERE job_title = ‘%Manager%’;

DELETE job_title FROM jobs WHERE IN(job_title) = ‘%Manager%’;

DELETE jobs FROM jobs_id = ‘*MGR*’


Flag question

Question text

d. DELETE FROM jobs WHERE job_title LIKE Diana Lorentz was transferred to Administration departme
'%Manager%'; Select one:

Question 6
Correct
Mark 1.00 out of 1.00

a. UPDATE FROM employees SET manager_id =


200, department_id = 10 WHERE last_name = 'Lorentz' AND f

Flag question UPDATE employees SET manager_id = 200, department_id =

Question text UPDATE FROM employees SET manager_id = 200, SET depart

UPDATE
Add a 500 pesos increase in salary of all employees who employees
have rendered SET manager_id
services = 200,
10 years and SET department_
above.
Select one:

UPDATE employees SET salary = salary + 500 where TO_CHAR(sysdate,'YYYY') -


TO_CHAR(hire_date,'YYYY') >= 10

UPDATE salary FROM employees SET salary + 500 where TO_YEAR(sysdate,'YYYY') -


TO_YEAR(hire_date,'YYYY') >= 10 Question 8
Correct
UPDATE salary= salary + 500 where TO_DATE(sysdate,'YYYY')Mark
- 1.00 out of 1.00
TO_DATE(hire_date,'YYYY') >= 10

UPDATE employees SET salary = salary + 500 where YEAR(sysdate,'YYYY') - YEAR(hire_date,'YYYY') >= 10

Flag question

Question text

Remove the Shareholder Services department in the depa

Question 7
Select one: d. SELECT first_name, last_name, salary FROM
employees
DELETE * FROM departments_name HAVING department_name LIKEJOIN departments
'%Shareholder USING (department_id) WHERE
Services%'

DELETE FROM departments WHERE department_name = ‘Shareholder Services’

Question 10
DELETE departments FROM departments_name WHERE department_name = ‘%Shareholder Services%’
None of the choices Correct
Mark 1.00 out of 1.00

Flag question

Question 9
Correct
Question text
Mark 1.00 out of 1.00
Given the SQL command
SELECT * FROM employees JOIN departments USING (dep
Which of the following describes the SQL command?
Select one:

Flag question

Question text
a. Results to invalid relational operator
Display the location id of all employee's name and salary whose salary is from 5000 to 10000.
Select one: b. Joined table from the employees and
department table

Results to invalid
SELECT employees.first_name, employees.last_name, employees.salary FROM SQL commandJOIN departments ON (depar
employees

Cartesian
SELECT first_name, last_name, salary FROM employees JOIN ProductUSING (department_id) WHERE MIN(salary) =
departments

Display a full FROM


SELECT employees.first_name, employees.last_name, employees.salary outer join
employees CROSS JOIN departments US

You might also like