Database by Kuya NR Newdocx
Database by Kuya NR Newdocx
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
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
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?
Remove flag
a. SELECT AVG(salary) FROM employees
WHERE job_id = 'FI_ACCOUNT';
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.
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.
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
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:
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
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
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.
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
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 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 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
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
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
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';
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
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
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';
Question 19 Question 21
Complete Complete
Mark 2.00 out of 2.00 Mark 2.00 out of 2.00
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 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 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 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 2
Correct
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
Question 3
Incorrect
Flag question
Question text
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
Select one:
Question 4
Correct a. Oracle SQL Developer; ANSI SQL Web
Mark 1.00 out of 1.00
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’);
Question text
Question 7
Correct a. SELECT * FROM EMPLOYEES WHERE job_id
Mark 1.00 out of 1.00
LIKE '%ACCOUNT%';
Which of the following SQL commands will display all stocks whose class is HW or AP.
Select one:
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
State Finished
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:
d. SELECT * FROM onhand WHERE parts BETWEEN onhand = 10 AND onhand = 30;
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:
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
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;
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
b. CREATE
d. DELETE
e. SELECT * FROM parts ORDER BY price
e. UPDATE Question 2
Correct
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
Select one:
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
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
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;
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 partnumber, description, warehouse FROM parts WHERE partnum LIKE 'K*';
SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE '*K*';
SELECT partnumber, description, warehouse FROM parts WHERE partnum = LIKE ‘K%’;
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
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
Select one:
SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN 'D'
Question 8
Flag question Correct
Mark 1.00 out of 1.00
Question text
SQL
MySQL Plus
a. DESCRIBE
ANSI SQL
b. DISPLAY TABLE
Question 7
c. DISPLAY
d. DISPLAY STRUCTURE
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
Flag question
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?
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'
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 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
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
Flag question
c. SELECT department_id, SUM(salary) FROM
Question 10
Correct
SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM
Mark parts GROUP
1.00 out of 1.00 BY warehouse, class
Flag question
Question 9
Correct
Mark 1.00 out of 1.00
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
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
Question text
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
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
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'
BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2
My courses
Question 20
Correct
Mark 1.00 out of 1.00
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
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 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
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 );
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
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';
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;
d.
employees GROUP BY department_id
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
Question 11
Correct
Mark 1.00 out of 1.00
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 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
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
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 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
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
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
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
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
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
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 text
Question 4
Correct
DELETE * FROM departments_name HAVING department_name
MarkLIKE '%Shareholder
1.00 out of 1.00 Services%'
Question text
Flag question
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
Flag question
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.
INSERT FROM departments(department_id, department_name, manager_id, location_id) VALUES (300, 'Training', 203, 2
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
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
BL-PROG-3114-LAB-1922S
PROGG(ORACLE DATABASE) NCIIIP2
Question 2
Correct
My courses Mark 1.00 out of 1.00
INSERT FROM departments(department_id, department_name, manager_id, location_id) VALUES (300, 'Training', 203, 2
Flag question
Question text
Flag question
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
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 YEAR(sysdate,'YYYY') - YEAR(hire_date,'YYYY') >= 10
Flag question
Question text
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%'
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