Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Home My courses CS-350-LEC-1913T Week 8: Midterm Examination Midterms



Question 1 Given the output below. Which of the following is the correct
 Not yet PL/SQL to be used?
answered
 Marked out of
1.00

 Select one:
a. SELECT DESCRIPTION, ONHAND,CLASS
FROM PARTS
WHERE CLASS = HW;

b. SELECT DESCRIPTION, ONHAND,CLASS


FROM PARTS
WHERE ONHAND IN(50,21,22);

c. SELECT DESCRIPTION, ONHAND,CLASS


FROM PARTS
WHERE CLASS = ‘HW’;

d. SELECT DESCRIPTION, ONHAND,CLASS


FROM PARTS
WHERE ONHAND >=21;

Clear my choice

Question 2 A system used to concatenate one column to another column.


Not yet
answered
Select one:
Marked out of
a. AS
1.00
b. ( )

c. ||

d. *

Clear my choice
Question 3 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
 1.00


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’;

Clear my choice

Question 4 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
1.00

Select one:
a. SELECT * FROM PARTS;

b. SELECT ALL FROM PARTS;

c. SELECT * FROM TABLE PARTS;

d. SELECT ALL COLUMN FROM PARTS;

Clear my choice

Question 5 This is use to Selects the columns in a table that are returned by
Not yet a query. Selects a few or as many of the columns as required.
answered

Marked out of Select one:


1.00
a. Inclusion

b. Projection

c. Selection

d. Joins

Clear my choice
Question 6 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
 1.00

 Select one:
a. SELECT DISTINCT WAREHOUSE, CLASS FROM PARTS;
 b. SELECT WAREHOUSE, CLASS FROM PARTS;

c. SELECT DISTINCT WAREHOUSE, CLASS FROM PARTS WHERE



WAREHOUSE >=1;

 d. SELECT WAREHOUSE, CLASS FROM PARTS WHERE CLASS IN


(‘AP’,’SG’,’HW’);
 Clear my choice

Question 7 True/False. Character strings and date values are enclosed with
Not yet double quotation marks.
answered

Marked out of
Answer: False
1.00

Question 8 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

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?

SELECT CLASS, WAREHOUSE FROM PARTS WHERE WAREHOUSE =


3;

SELECT CLASS, WAREHOUSE FROM PARTS WHERE WAREHOUSE =


‘3’;

SELECT CLASS, WAREHOUSE FROM PARTS WHERE WAREHOUSE =


=3;

SELECT CLASS, WAREHOUSE =3 FROM PARTS WHERE WAREHOUSE


= 3;

Question 9 True/False. A null value means that the value is unavailable,


Not yet unassigned, unknown, or inapplicable.
answered

Marked out of
Answer: True
1.00
Question 10 It is a value that is unavailable, unassigned, unknown, or
Not yet inapplicable.
answered

Marked out of Select one:


 1.00
a. Space

 b. NULL

c. Blank

d. Zero

 Clear my choice


Question 11 Choose the letter of the correct answer based on table PARTS as
 Not yet shown below
answered

 Marked out of
1.00

 
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.

SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE


ONHAND >=21;

SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE


ONHAND <=21;

SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE


ONHAND =21;

SELECT DESCRIPTION, ONHAND, WAREHOUSE FROM PARTS WHERE


ONHAND >21;

Question 12 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

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

SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS


WHERE PARTNUM LIKE ‘K%’;

SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS


WHERE PARTNUM LIKE ‘%K’;

SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS


WHERE PARTNUM LIKE ‘%K%’;

SELECT (DESCRIPTION|| ‘WITH A PRICE OF’ || PRICE) FROM PARTS


WHERE PARTNUM LIKE ‘__K%’;
Question 13 This is used to display rows based on a range of values.
Not yet
answered
Select one:
Marked out of
 a. IN
1.00
b. Comparison
 c. Between

 d. Like

Clear my choice

 Question 14 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
 answered

Marked out of
 1.00

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

SELECT (PARTNUM || ‘is the part number of’|| DESCRIPTION ||


‘which belongs to’ || WAREHOUSE FROM PARTS WHERE PARTNUM
NOT LIKE ‘%ER’;

SELECT (PARTNUM || ‘is the part number of’ ||DESCRIPTION ||


‘which belongs to’ || WAREHOUSE) FROM PARTS WHERE PARTNUM
NOT LIKE ‘ER%’;

SELECT (PARTNUM ‘is the part number of’ DESCRIPTION‘which


belongs to’WAREHOUSE) FROM PARTS WHERE PARTNUM NOT LIKE
‘%ER’;

SELECT (PARTNUM || ‘is the part number of’ ||DESCRIPTION ||


‘which belongs to’ || WAREHOUSE) FROM PARTS WHERE PARTNUM
LIKE ‘%ER’;

Question 15 True/False. The != not equal to symbol is also equal to this


Not yet symbol<>.
answered

Marked out of
Answer: True
1.00

Question 16 This is use to create expression with number and date values.
Not yet
answered
Select one:
Marked out of
a. Arithmetic expression
1.00
b. MDAS operator

c. Numerical Values

d. Logical Condition

Clear my choice
Question 17 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
 1.00


Select one:
 a. SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS

 WHERE CLASS = ‘AP’ OR ONHAND BETWEEN 8 AND 12;


b. SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS

WHERE CLASS = ‘AP’ AND DESCRIPTION LIKE ‘%ER’;


c. SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE CLASS = ‘AP’ OR DESCRIPTION LIKE ‘%ER’;

d. SELECT DESCRIPTION, ONHAND, CLASS


FROM PARTS
WHERE CLASS = ‘AP’ AND ONHAND BETWEEN 8 AND 12;

Clear my choice

Question 18 This is used to in conditions that compare one expression with


Not yet another value or expression.
answered

Marked out of Select one:


1.00
a. Subtraction

b. Logical Condition

c. Comparison

d. Add

Clear my choice
Question 19 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
 1.00


Select one:
 a. SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS

 WHERE CLASS = ‘AP’ OR DESCRIPTION LIKE ‘__S%’;


b. SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS

WHERE CLASS = ‘AP’ OR ONHAND BETWEEEN 8 AND 12


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%’;

Clear my choice

Question 20 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

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’;
Question 21 This is used to perform wildcard searches of valid search string
Not yet values.
answered

Marked out of Select one:


 1.00
a. Between

 b. IN

c. Comparison

d. Like

 Clear my choice


Question 22 It is a character, a number, or a date that is included in the
 Not yet SELECT statement.
answered

 Marked out of Select one:


1.00
a. Alias

b. Literal

c. Table name

d. String

Clear my choice

Question 23 This is used to brings together data that is stored in different


Not yet tables by specifying the link between them.
answered

Marked out of Select one:


1.00
a. Selection

b. Inclusion

c. Projection

d. Joins

Clear my choice

Question 24 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

 
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;

SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE


> 500;

SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE


<=500;

SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE


>= 500;
Question 25 This is used to selects the rows in a table that are returned by a
Not yet query. Various criteria can be used to restrict the rows that are
answered
retrieved.
Marked out of
 1.00
Select one:
a. Inclusion

b. Projection
 c. Joins

d. Selection

Clear my choice

 Question 26 Which of the following is not true about writing SQL statements?
Not yet
 answered
Select one:
Marked out of
a. Keywords cannot be split across lines or abbreviated.
1.00
b. SQL statements are not case sensitive.

c. Clauses are usually placed on separate lines for


readability and ease of editing.

d. Indents should be used to make code more readable.

Clear my choice

Question 27 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

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)

SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE


PARTNUM IN (‘AT94’,’DR93’,’KV29’);

SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE


PARTNUM IN (AT94,DR93,KV29);

SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE


PARTNUM = (‘AT94’,’DR93’,’KV29’);

SELECT PARTNUM, CLASS, ONHAND FROM PARTS WHERE


PARTNUM NOT IN (‘AT94’,’DR93’,’KV29’);

Question 28 This character is used to override the default precedence or to


Not yet clarify the statement.
answered

Marked out of Select one:


1.00
a. ( )

b. *

c. AS

d. ||

Clear my choice
Question 29 This is used to test for values in a specified set of values.
Not yet
answered
Select one:
Marked out of
 a. Like
1.00
b. Between
 c. IN

 d. Comparison

Clear my choice

 Question 30 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
 answered

Marked out of
 1.00

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;

Clear my choice

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


Not yet
answered
Answer: True
Marked out of
1.00

Question 32 This is used to in conditions that compare one expression with


Not yet another value or expression.
answered

Marked out of Select one:


1.00
a. Add

b. Comparison

c. Subtraction

d. Logical Condition

Clear my choice
Question 33 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
 1.00


Which of the following is the correct report that will display the
 DESCRIPTION, WAREHOUSE AND distinct value for CLASS.

SELECT DESCRIPTION, WAREHOUSE, DISTINCT (CLASS) FROM



PARTS;

 SELECT DESCRIPTION, WAREHOUSE, CLASS FROM PARTS;

SELECT DISTINCT DESCRIPTION, WAREHOUSE, CLASS FROM PARTS;

SELECT DESCRIPTION, WAREHOUSE, DISTINCT ‘CLASS ‘ FROM


PARTS;

Question 34 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used
answered

Marked out of
1.00

Select one:
a. SELECT DISTINCT WAREHOUSE FROM PARTS;

b. SELECT DICTINCT WAREHOUSE, CLASS FROM PARTS WHERE


WAREHOUSE >=1;

c. SELECT WAREHOUSE, CLASS FROM PARTS;

d. SELECT WAREHOUSE, CLASS FROM PARTS WHERE CLASS IN


(‘AP’,’SG’,’HW’);

Clear my choice
Question 35 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
 1.00


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;

SELECT DESCRIPTION, CLASS, PRICE FROM PARTS WHERE CLASS <>


AP;

Question 36 This is used to perform wildcard searches of valid search string


Not yet values.
answered

Marked out of Select one:


1.00
a. Comparison

b. Between

c. IN

d. Like

Clear my choice

Question 37 True/False Character values are format sensitive and date


Not yet values are case sensitive-sensitive.
answered

Marked out of
Answer: False
1.00
Question 38 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
 1.00


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’;

Question 39 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

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;

SELECT DESCRIPTION, PRICE + 10000 AS NEW PRICE LISTS FROM


PARTS ORDER BY PRICE DESC;

SELECT DESCRIPTION, PRICE + 10000 AS “NEW PRICE LISTS” FROM


PARTS ORDER BY PRICE;

SELECT DESCRIPTION, PRICE + 10000 + PRICE AS “NEW PRICE LISTS”


FROM PARTS ORDER BY PRICE DESC;

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


Not yet
answered
Select one:
Marked out of
a. IN
1.00
b. Comparison

c. Between

d. Like

Clear my choice
Question 41 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
 1.00


Which of the following is the correct report showing all rows and
 columns sort the description in ascending order.

SELECT * FROM PARTS ORDER BY DESCRIPTION DESC;



SELECT * FROM PARTS ORDER BY DESCRIPTION;
 SELECT * FROM PARTS ORDER BY DESCRIPTION ASC;

SELECT * FROM PARTS ORDER BY DESC;

Question 42 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
1.00

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;

SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE


BETWEEN 500 AND 500;

SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE


BETWEEN =200 AND 500;

SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE


BETWEEN 200 AND BETWEEN 500;
Question 43 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
 1.00


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

 SELECT DESCRIPTION, PARTNUM, CLASS, PRICE FROM PARTS


WHERE CLASS=’HW’;

SELECT DESCRIPTION, PARTNUM, CLASS, PRICE FROM


PARTS WHERE class="HW";

SELECT ‘DESCRIPTION’, ‘PARTNUM’, ‘CLASS’, ‘PRICE’ FROM PARTS


WHERE CLASS=’HW’;

SELECT COLUMN DESCRIPTION, PARTNUM, CLASS, PRICE FROM


PARTS WHERE CLASS=’HW’;

Question 44 Supposed that the user uses the ff SELECT statement: what will
Not yet be the possible output.
answered
SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT;
Marked out of
1.00
Select one:
a. Will display the column GRADE rename as STUDENT MARK

b. Will display all rows and columns.

c. Error because of the keyword AS.

d. Error because of missing “” mark.

Clear my choice

Question 45 This is used to restrict the rows that are returned by a query.
Not yet
answered
Select one:
Marked out of
a. Select
1.00
b. Delete

c. Where

d. Insert

Clear my choice
Question 46 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
 1.00


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’;

Clear my choice

Question 47 Given the output below. Which of the following is the correct
Not yet PL/SQL to be used?
answered

Marked out of
1.00

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’;

Clear my choice

Question 48 This is used to test for values in a specified set of values.


Not yet
answered
Select one:
Marked out of
a. IN
1.00
b. Between

c. Like

d. Comparison

Clear my choice
Question 49 Choose the letter of the correct answer based on table PARTS as
Not yet shown below
answered

Marked out of
 1.00


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’;

Question 50 This is used to restrict the rows that are returned by a query.
Not yet
answered
Select one:
Marked out of
a. Delete
1.00
b. Where

c. Select

d. Insert

Clear my choice

Stay in touch
AMA EDUCATION SYSTEM
 https://blended.amauonline.com/helpdesk

You might also like