DATABASE MGT. S-WPS Office
DATABASE MGT. S-WPS Office
DATABASE MGT. S-WPS Office
SYSTEM 1(ORACLE)
Given the output below. Which of the following is the correct PL/SQL to be used
Select one:
Question 2
Correct
Question text
Ans: IN
Ans: NULL
True/False Character values are format sensitive and date values are case sensitive-sensitive.
Ans: False
Ans: ||
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column DESCRIPTION, ONHAND and
WAREHOUSE of all PARTS where ONHAND is greater than or equal to 21.
Ans: SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE ONHAND >=21;
Given the output below. Which of the following is the correct PL/SQL to be used?
Ans: SELECT DESCRIPTION, PRICE *.5 +PRICE-100 FROM PARTS WHERE PRICE >10000;
Select one:
d. Clauses are usually placed on separate lines for readability and ease of editing.
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report that will merge the column DESCRIPTION and PRICE put a
literal character string of = “ with a price of ” in between the two columns. Limit the rows returned by
getting only the partnum that starts with letter ‘K’.
Ans: SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS WHERE PARTNUM LIKE ‘K%’;
Ans: IN
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND BETWEEEN 8 AND 12
FROM PARTS
FROM PARTS
FROM PARTS
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
Feedback
This is use to create expression with number and date values.
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
Ans: Like
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column DESCRIPTION, PARTNUM, CLASS and
PRICE of all parts where the description fourth letter starting from the first is equal to ‘D’.
SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS WHERE DESCRIPTION LIKE ‘___D%’;
SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS WHERE DESCRIPTION LIKE ‘%D___’;
SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS WHERE DESCRIPTION LIKE ‘D%’;
SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS WHERE DESCRIPTION LIKE ‘%D’;
This is use to Selects the columns in a table that are returned by a query. Selects a few or as many of the
columns as required.
Ans: Projection
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing the column PARTNO, DESCRIPTION and WAREHOUSE.
Get only that description that does not ends with ‘ER’. Note that you have to merge the said three
columns, rename the merge column as “Parts Record”. Below is the sample output for column.
Parts Record
Ans: SELECT (PARTNUM || ‘is the part number of’|| DESCRIPTION || ‘which belongs to’ || WAREHOUSE
FROM PARTS WHERE PARTNUM NOT LIKE ‘%ER’;
Ans: Where
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column PARTNUM, DESCRIPTION and PRICE
of all PARTS where price is less than 500. Sort the PRICE in ascending order.
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE < 500;
What Given the output below. Which of the following is the correct PL/SQL to be used?
FROM PARTS
Which of the following is the correct report that will display the DESCRIPTION, WAREHOUSE AND distinct
value for CLASS.
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column DESCRIPTION, CLASS and PRICE of all
PARTS where class is not equal to AP.
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS NOT LIKE ‘%AP%’;
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS NOT LIKE ‘%AP’;
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS <> AP;
Given the output below. Which of the following is the correct PL/SQL to be used?
Supposed that the user uses the ff SELECT statement: what will be the possible output.
SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT;
Ans: Literal
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
FROM PARTS
FROM PARTS
FROM PARTS
WHERE CLASS = ‘AP’ AND ONHAND BETWEEN 8 AND 12;
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report that will list only the column DESCRIPTION, PARTNUM,
CLASS, and PRICE of all PART whose CLASS is equal to HW.
Ans: SELECT DESCRIPTION, PARTNUM, CLASS, PRICE FROM PARTS WHERE CLASS=’HW’;
True/False. Character strings and date values are enclosed with double quotation marks.
Ans:False
This is used to in conditions that compare one expression with another value or expression.
Ans: Comparison
Given the output below. Which of the following is the correct PL/SQL to be used?
FROM PARTS
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column DESCRIPTION, ONHAND, CLASS and
PRICE of all price where the description ends with letter ‘N’.
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE DESCRIPTION LIKE ‘%N’;
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE DESCRIPTION LIKE ‘N%’;
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE DESCRIPTION LIKE ‘%N%’;
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE DESCRIPTION NOT LIKE ‘%N’;
This is used to brings together data that is stored in different tables by specifying the link between them.
Ans: Joins
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column PARTNUM, CLASS and ONHAND of all
parts where partnum is equal to AT94, DR93 and KV29. (Note 1 query only and do not use logical
condition)
Ans: SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE PARTNUM IN (‘AT94’,’DR93’,’KV29’);
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report that will display the distinct value for CLASS and
WAREHOUSE limit the rows by getting only the parts under WAREHOUSE 3?
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
FROM PARTS
FROM PARTS
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column DESCRIPTION, WAREHOUSE, CLASS
and PRICE of all parts where the description contains keyword ‘SHE’.
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE DESCRIPTION LIKE ‘%SHE%’;
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE DESCRIPTION LIKE ‘SHE%’;
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE DESCRIPTION LIKE ‘%SHE’;
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE DESCRIPTION LIKE ‘SHE’;
Ans: True
Ans: Between
True/False. A null value means that the value is unavailable, unassigned, unknown, or inapplicable.
Ans: True
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column CLASS, DESCRIPTION and PRICE of all
PARTS where price range is between 200 to 500. Sort the Price in descending order.
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE BETWEEN 200 AND 500;
This is used to in conditions that compare one expression with another value or expression.
Ans: Comparison
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report showing all rows and columns sort the description in
ascending order.
Ans: Like
This is used to selects the rows in a table that are returned by a query. Various criteria can be used to
restrict the rows that are retrieved.
Ans: Selection
Ans: True
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing the DESCRIPTION and Price (Note that in column
PRICE add ADDITIONAL 10000). Get only the prices with no digit that is equal to ‘5’. Note that you have
to concatenate the said column and rename the merge column as “New Price Lists”. Sort the data in
DESC order by Price.
SELECT DESCRIPTION, PRICE + 10000 AS “NEW PRICE LISTS” FROM PARTS ORDER BY PRICE DESC;
Ans: Between
Ans: Where
This character is used to override the default precedence or to clarify the statement.
Ans: ( )
-----------
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
What query should be used in order todisplay the firstname and length of firstname rename the column
length of firstname as Number of Character of all employees whose salary is between 4400 and 8300
Select one:
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
What query should be used in order to display the employees lastname concatenated to salary. Format
the salary column to 6 character long left padded with ‘*’ as special character for all employees whose
manager_id is null or salary between 4000 and 6000 Rename the column as employees and their
Salaries
Select one:
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
What query should be used in order to display the employees lastname concatenated with firstname and
with a ‘, (comma)’ in between. A rename on the concatenated column as Complete Name. Note all
values in Complete Name column should be in lowercase plus display the length of employees lastname
for all employees whose lastname starts with letter M sort the lastname in its default order.
Select one:
LENGTH(LASTNAME)
FROM EMPLOYEES
LENGTH(LASTNAME)
FROM EMPLOYEES
LENGTH(LASTNAME)
FROM EMPLOYEES
LENGTH(LASTNAME)
FROM EMPLOYEES
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
What query should be used in order to display the firstname concatenated to salary with additional
column salary that provides a computation of salary * 2. Rename the column as Increase of all
employees whose lastname ends with N.
Select one:
a. SELECT lower(FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE WLL GOT
A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME LIKE 'N%';
b. SELECT (FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE WLL GOT A NEW
SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME LIKE '%N';
c. SELECT (FIRSTNAME || 'SALARY OF' SALARY 'IF MULITPLY BY TWO THEN HE/SHE WLL GOT A NEW
SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME LIKE 'N%';
d. SELECT (FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE WLL GOT A NEW
SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME LIKE 'N%';
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
d. 0
0
0
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Based on the given SELECT statement below what would be the possible output?
Select one:
a. 563.3
b. 563.39
c. 563
d. 500
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
What query should be used in order toget theSUBSTR function that returns the job_id = ‘REP’.
Select one:
WHERE SUBSTR(JOB_ID,4)='%REP%';
WHERE SUBSTR='REP';
WHERE SUBSTR(JOB_ID,4)='REP';
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
What query should be used in order todisplay the Firstname concatenated to employees original salary
plus concatenate again a new column salary that multiplies the original salary into three. Rename the
column as Dream Salaries.Note sort the salary in descending order.
Select one:
AS "DREAM SALARIES"
FROM EMPLOYEES
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY;
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY;
AS "DREAM SALARIES"
FROM EMPLOYEES
Select one:
a. 00
b. 60
c. 0
d. 600
Based on the given SELECT statement below what would be the possible output?
Select one:
a. 563.39
b. 563
c. 563.3
d. 500
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Based on the given SELECT statement below what would be the possible output?
AND SALARY=17000;
Select one:
Feedback
Question 2
Correct
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the salary leftpadded with 15 character long and ‘$’ as
special character and another column salary right padded with 10 character long with ‘@’ as special
character used of all employees in 201, 176 and 144.
Select one:
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);
Feedback
Question 3
Correct
Question text
Select one:
b. Character function
c. Number function
Question 4
Incorrect
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Select one:
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
Question 5
Incorrect
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Based on the given SELECT statement below what would be the possible output?
Select one:
a. 563
b. 563.39
c. 563.3
d. 500
Feedback
Your answer is incorrect.
Question 6
Correct
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
Select one:
a. king,steven
hunold,alexander
Ernst,bruce
lorentz,Diana
b. King,Steven
Hunold,Alexander
Ernst,Bruce
Lorentz,Diana
c. KING,STEVEN
HUNOLD,ALEXANDER
ERNST,BRUCE
LORENTZ,DIANA
d. King’,’Steven
Hunold’,’Alexander
Ernst’,’Bruce
Lorentz’,’Diana
Feedback
Question 7
Incorrect
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Select one:
FROM EMPLOYEES
b. SELECT TRIM(LASTNAME,’A’)
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
Question 8
Correct
Question text
Select one:
a. INSTR
b. Length
c. SUBSTR
d. Trim
Question 9
Incorrect
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 50
Select one:
Feedback
Question 10
Incorrect
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the lastname and salary of all employees whose
department_id = 60 or job_id like ‘_T%’. Format the salary to be 15 character long, left padded with ‘$’
as special character. Label the column Salary.
Select one:
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 60 OR JOB_ID LIKE '_T';
----------
SELECT SUM(QTY) FROM STOCKS WHERE WAREHOUSE IN (1,5) GROUP BY WAREHOUSE HAVING
MAX(WAREHOUSE) >=5;
Answer:
FROM INVENTORY;
Question 2
Incorrect
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
Feedback
Question 3
Incorrect
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Which of the following is the correct report that display the smallest (minimum) Surname.. and apply the
ff. functions:
Get the average salary; Group the data per job_id; Get only job_id with a keyword “REP”; and Apply
having clause, which the max salary per job_id is greater than 5000.
Select one:
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;
c. SELECT MIN(LASTNAME), AVG(SALARY)
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;
Feedback
Question 4
Correct
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Which of the following is the correct query that display the maximum lastname concatenated to
firstname and rename the column as “Employees Name”, Job_id and apply the ff. functions:
Count the Job_id; Apply where condition whose lastname ends with letter ‘N’; Group the job_id; and
Apply having clause of employees having average salary that is greater than 10000.
Select one:
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;
FROM EMPLOYEES
WHERE LASTNAME LIKE '%N'
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING AVG(SALARY)<10000;
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;
Feedback
Your answer is correct.
Question 5
Not answered
Question text
Answer:
Question 6
Not answered
Question text
Answer:
Question 7
Not answered
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
Feedback
Question 8
Not answered
Question text
Answer:
Question 9
Not answered
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
a. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
b. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
c. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
d. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
Feedback
Question 10
Not answered
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
FROM EMPLOYEES;
FROM EMPLOYEES;
FROM EMPLOYEES;
d. SELECT MAX(LASTNAME||FIRSTNAME) AS NAME, MAX(SALARY)
FROM EMPLOYEES;
-------
Dashboard
My courses
BL-IT-6202-LEC-1923T
Quiz 005
State Finished
Marks 9.00/10.00
Question 1
Incorrect
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
Select one:
Feedback
Question 2
Correct
Question text
It is a table that is owned by the user SYS and can be accessed by all users.
Select one:
a. Employees
b. Parts
c. Authors
d. Dual
Question 3
Correct
Question text
a. Single row
b. Multiple row
c. Dual table
d. Number function
Question 4
Correct
Question text
This is used to converts the first letter of each word to uppercase and the remaining letters to lowercase.
Select one:
a. Upper case
b. Sentence case
c. INITCAT
d. lowercase
Question 5
Correct
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
FROM EMPLOYEES
OR SALARY IS NULL;
Select one:
Feedback
Question 6
Correct
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
Select one:
a. ABELELLEN SA_REP
b. ABELELLEN SA_REP
TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
FAYPAT MK_REP
c. ABELELLEN SA_REP
TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
Feedback
Question 7
Correct
Question text
This is use to accept character input and can return both character and number values.
Select one:
a. Number function
d. Character function
Question 8
Correct
Question text
This is use to find the numeric position of a named character starting at character position n.
Select one:
a. Length
b. INSTR
c. Trim
d. SUBSTR
Question 9
Correct
Question text
Select one:
a. SUBSTR
b. Trim
c. Length
d. INSTR
Question 10
Correct
Question text
Select one:
a. Single row
b. Number function
c. Multiple row
d. Dual table