Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

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.

Select one:
a.
Inclusion
b.
Projection
c.
Joins
d.
Selection
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.

Select one:
a.
Projection
b.
Joins
c.
Selection
d.
Inclusion
A system used to concatenate one column to another column.

Select one:
a.

b.
*
c.
AS
d.
||
It is a character, a number, or a date that is included in the SELECT statement.
Select one:
a.
Alias
b.
Table name
c.
Literal
d.
String
It is a value that is unavailable, unassigned, unknown, or inapplicable.

Select one:
a.
Space
b.
NULL
c.
Blank
d.
Zero
Supposed that the user uses the ff SELECT statement: what will be the possible
output.

SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT;

Select one:
a.
Error because of missing “” mark.
b.
Will display the column GRADE rename as STUDENT MARK
c.
Will display all rows and columns.
d.
Error because of the keyword AS.
This character is used to override the default precedence or to clarify the statement.
Select one:
a.
or ( )
b.
*
c.
||
d.
AS
This is used to brings together data that is stored in different tables by specifying the
link between them.
Select one:
a. Selection
b. Projection
c. Inclusion
d. Joins

Which of the following is not true about writing SQL statements?


Select one:
a. Indents should be used to make code more readable.
b. SQL statements are not case sensitive.
c. Clauses are usually placed on separate lines for readability and ease of editing.
d. Keywords cannot be split across lines or abbreviated.

This is use to create expression with number and date values.


Select one:
a. Numerical Values
b. Arithmetic expression
c. Logical Condition
d. MDAS operator
Given the output below. Which of the following is the correct PL/SQL to be used

Select one:
a.
SELECT DISTINCT WAREHOUSE FROM PARTS;
b.
SELECT WAREHOUSE, CLASS FROM PARTS WHERE CLASS IN
(‘AP’,’SG’,’HW’);
c.
SELECT DICTINCT WAREHOUSE, CLASS FROM PARTS WHERE
WAREHOUSE >=1;
d.
SELECT WAREHOUSE, CLASS FROM PARTS;

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.
A. SELECT DESCRIPTION, PARTNUM, CLASS, PRICE FROM PARTS WHERE
CLASS=’HW’;
B. SELECT DESCRIPTION, PARTNUM, CLASS, PRICE FROM PARTS WHERE
class="HW";
C. SELECT ‘DESCRIPTION’, ‘PARTNUM’, ‘CLASS’, ‘PRICE’ FROM PARTS
WHERE CLASS=’HW’;
D. SELECT COLUMN DESCRIPTION, PARTNUM, CLASS, PRICE FROM
PARTS WHERE CLASS=’HW’;

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’.
A. SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS
WHERE DESCRIPTION LIKE ‘___D%’;
B. SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS
WHERE DESCRIPTION LIKE ‘%D___’;
C. SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS
WHERE DESCRIPTION LIKE ‘D%’;
D. SELECT DESCRIPTION, PARTNUM, CLASS, PRICES FROM PARTS
WHERE DESCRIPTION LIKE ‘%D’;

This is used to display rows based on a range of values.

Select one:
a.
Comparison
b.
IN
c.
Between
d.
Like

Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
a.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ AND DESCRIPTION LIKE ‘%ER’;
b.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND BETWEEN 8 AND 12;
c.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ AND ONHAND BETWEEN 8 AND 12;
d.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR DESCRIPTION LIKE ‘%ER’;
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.
A.
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE
BETWEEN 200 AND 500;
B.
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE
BETWEEN 500 AND 500;
C.
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE
BETWEEN =200 AND 500;
D.
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE
BETWEEN 200 AND BETWEEN 500;
This is used to restrict the rows that are returned by a query.

Select one:
a.
Delete
b.
Insert
c.
Select
d.
Where
True/False. Character strings and date values are enclosed with double quotation
marks.

Answer: 
False

This is used to perform wildcard searches of valid search string values.

Select one:
a.
Comparison
b.
Like
c.
IN
d.
Between
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.
A.
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS NOT
LIKE ‘%AP%’;
B.
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS NOT
LIKE ‘%AP’;
C.
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS != AP;
D.
SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS <> AP;

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.
A.
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE <
500;
B.
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE >
500;
c.
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE
<=500;
C.
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE >=
500;

Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
a.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR CLASS = ‘HW’;
b.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE DESCRIPTION LIKE ‘R%’;
c.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS IN (‘HW’,’AP’);
d.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE DESCRIPTION LIKE ‘%R’;
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’.
A.
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE
DESCRIPTION LIKE ‘%SHE%’;
B.
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE
DESCRIPTION LIKE ‘SHE%’;
C.
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE
DESCRIPTION LIKE ‘%SHE’;
D.
SELECT DESCRIPTION, WAREHOUSE, CLASS, PRICE FROM PARTS WHERE
DESCRIPTION LIKE ‘SHE’;
Given the output below. Which of the following is the correct PL/SQL to be used?

Select one:
a.
SELECT * FROM PARTS;
b.
SELECT ALL COLUMN FROM PARTS;
c.
SELECT ALL FROM PARTS;
d.
SELECT * FROM TABLE PARTS;
This is used to in conditions that compare one expression with another value or
expression.

Select one:
a.
Logical Condition
b.
Add
c.
Subtraction
d.
Comparison
Given the output below. Which of the following is the correct PL/SQL to be used?

Select one:
a.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND BETWEEEN 8 AND 12
b.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR DESCRIPTION LIKE ‘__S%’;
c.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND >=8;
d.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ AND DESCRIPTION LIKE ‘__S%’;
This is used to test for values in a specified set of values.

Select one:
a.
IN
b.
Between
c.
Comparison
d.
Like
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’.
A.
SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS WHERE
PARTNUM LIKE ‘K%’;
B.
SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS WHERE
PARTNUM LIKE ‘%K’;
C.
SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS WHERE
PARTNUM LIKE ‘%K%’;
D.
SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS WHERE
PARTNUM LIKE ‘__K%’;

True/False. A null value means that the value is unavailable, unassigned, unknown, or
inapplicable.

Answer: 
True

iven the output below. Which of the following is the correct PL/SQL to be used?

Select one:
a.
SELECT DESCRIPTION, ONHAND,CLASS
FROM PARTS
WHERE ONHAND IN(50,21,22);
b.
SELECT DESCRIPTION, ONHAND,CLASS
FROM PARTS
WHERE CLASS = ‘HW’;
c.
SELECT DESCRIPTION, ONHAND,CLASS
FROM PARTS
WHERE CLASS = HW;
d.
SELECT DESCRIPTION, ONHAND,CLASS
FROM PARTS
WHERE ONHAND >=21;
Given the output below. Which of the following is the correct PL/SQL to be used?

Select one:
a.
SELECT (PARTNUM|| belong to||DESCRIPTION) FROM PARTS WHERE CLASS
= ‘SG’;
b.
SELECT (PARTNUM|| ‘belong to’||DESCRIPTION) FROM PARTS WHERE
CLASS = ‘SG’;
c.
SELECT (PARTNUM|| ‘belong to’||DESCRIPTION) FROM PARTS WHERE
PARTNUM IN (‘BV06,’KV29’)
d.
SELECT (PARTNUM|| ‘belong to’||DESCRIPTION) FROM PARTS WHERE
CLASS = SG;
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.
A.
SELECT DESCRIPTION, PRICE + 10000 AS “NEW PRICE LISTS” FROM
PARTS ORDER BY PRICE DESC;
B.
SELECT DESCRIPTION, PRICE + 10000 AS NEW PRICE LISTS FROM PARTS
ORDER BY PRICE DESC;
C.
SELECT DESCRIPTION, PRICE + 10000 AS “NEW PRICE LISTS” FROM
PARTS ORDER BY PRICE;
D.
SELECT DESCRIPTION, PRICE + 10000 + PRICE AS “NEW PRICE LISTS”
FROM PARTS ORDER BY PRICE DESC;
Given the output below. Which of the following is the correct PL/SQL to be used?

Select one:
a.
SELECT DESCRIPTION, PRICE *.5 +PRICE-100 FROM PARTS WHERE PRICE
>10000;
b.
SELECT DESCRIPTION, PRICE *.5 +PRICE-100 FROM PARTS WHERE PRICE
<10000;
c.
SELECT DESCRIPTION, (PRICE *.5 )+PRICE-100 FROM PARTS WHERE
PRICE >10000;
d.
SELECT DESCRIPTION, PRICE *.5 +(PRICE-100) FROM PARTS WHERE
PRICE <10000;
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.
A.
SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE
ONHAND >=21;
B.
SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE
ONHAND <=21;
C.
SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE
ONHAND =21;
D.
SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE
ONHAND >21;
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)
A.
SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE PARTNUM IN
(‘AT94’,’DR93’,’KV29’);
B.
SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE PARTNUM IN
(AT94,DR93,KV29);
C.
SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE PARTNUM =
(‘AT94’,’DR93’,’KV29’);
D.
SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE PARTNUM
NOT 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 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
AT94is the part number ofIRONwhich belong to warehouse3
A.
SELECT (PARTNUM || ‘is the part number of’|| DESCRIPTION || ‘which belongs to’
|| WAREHOUSE FROM PARTS WHERE PARTNUM NOT LIKE ‘%ER’;
B.
SELECT (PARTNUM || ‘is the part number of’ ||DESCRIPTION || ‘which belongs to’
|| WAREHOUSE) FROM PARTS WHERE PARTNUM NOT LIKE ‘ER%’;
C.
SELECT (PARTNUM ‘is the part number of’ DESCRIPTION‘which belongs
to’WAREHOUSE) FROM PARTS WHERE PARTNUM NOT LIKE ‘%ER’;
D.
SELECT (PARTNUM || ‘is the part number of’ ||DESCRIPTION || ‘which belongs to’
|| WAREHOUSE) FROM PARTS WHERE PARTNUM LIKE ‘%ER’;
Given the output below. Which of the following is the correct PL/SQL to be used?

Select one:
a.
SELECT DISTINCT WAREHOUSE, CLASS FROM PARTS;
b.
SELECT WAREHOUSE, CLASS FROM PARTS WHERE CLASS IN
(‘AP’,’SG’,’HW’);
c.
SELECT WAREHOUSE, CLASS FROM PARTS;
d.
SELECT DISTINCT WAREHOUSE, CLASS FROM PARTS WHERE
WAREHOUSE >=1;
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.
A.
SELECT * FROM PARTS ORDER BY DESCRIPTION DESC;
B.
SELECT * FROM PARTS ORDER BY DESCRIPTION;
C.
SELECT * FROM PARTS ORDER BY DESCRIPTION ASC;
D.
SELECT * FROM PARTS ORDER BY DESC;
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
a.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE DESCRIPTION LIKE ‘%L’;
b.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS IN (‘HW’,’SG’);
c.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE ONHAND >=9;
d.
SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE DESCRIPTION LIKE ‘%L%’;
True/False. The != not equal to symbol is also equal to this symbol<>.

Answer: 
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 DESCRIPTION,
ONHAND, CLASS and PRICE of all price where the description ends with letter ‘N’.
A.
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE
DESCRIPTION LIKE ‘%N’;
B.
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE
DESCRIPTION LIKE ‘N%’;
C.
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE
DESCRIPTION LIKE ‘%N%’;
D.
SELECT DESCRIPTION, ONHAND, CLASSS FROM PARTS WHERE
DESCRIPTION NOT LIKE ‘%N’;
True/False Character values are format sensitive and date values are case sensitive-
sensitive.

Answer: 
False

True/False. This symbol % denotes zero or many characters.

Answer: 
True
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?
A.
SELECT CLASS, WAREHOUSE FROM PARTS WHERE WAREHOUSE = 3;
B.
SELECT CLASS, WAREHOUSE FROM PARTS WHERE WAREHOUSE = ‘3’;
C.
SELECT CLASS, WAREHOUSE FROM PARTS WHERE WAREHOUSE = =3;
D.
SELECT CLASS, WAREHOUSE =3 FROM PARTS WHERE WAREHOUSE = 3;
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 DESCRIPTION,
WAREHOUSE AND distinct value for CLASS.
A.
SELECT DESCRIPTION, WAREHOUSE, DISTINCT (CLASS) FROM PARTS;
B.
SELECT DESCRIPTION, WAREHOUSE, CLASS FROM PARTS;
C.
SELECT DISTINCT DESCRIPTION, WAREHOUSE, CLASS FROM PARTS;
D.
SELECT DESCRIPTION, WAREHOUSE, DISTINCT ‘CLASS ‘ FROM PARTS;

You might also like