0% found this document useful (0 votes)
38 views7 pages

DBMS 1 Midterm Lab Exam, 1 - 10

DBMS 1 midterm lab exam, 1 - 10

Uploaded by

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

DBMS 1 Midterm Lab Exam, 1 - 10

DBMS 1 midterm lab exam, 1 - 10

Uploaded by

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

Wednesday, 18 December 2024,

Started on
8:16 PM
State Finished
Completed Wednesday, 18 December 2024,
on 8:31 PM
Time
15 mins 17 secs
taken
Marks 44.00/50.00
Grade 88.00 out of 100.00
窗体顶端

Question 1

Complete
Mark 1.00 out of 1.00
Flag question

Question text

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 DESCRIPTION LIKE ‘%L%’;

d.

SELECT DESCRIPTION, ONHAND, CLASS

FROM PARTS

WHERE ONHAND >=9;

Feedback

Your answer is correct.

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

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%’;
Mark 1.00 out of 1.00

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 = HW;

b.

SELECT DESCRIPTION, ONHAND,CLASS

FROM PARTS

WHERE CLASS = ‘HW’;

c.

SELECT DESCRIPTION, ONHAND,CLASS

FROM PARTS

WHERE ONHAND >=21;

d.

SELECT DESCRIPTION, ONHAND,CLASS

FROM PARTS

WHERE ONHAND IN(50,21,22);

Feedback

Your answer is correct.

This is used to in conditions that compare one expression with


another value or expression.
Select one:
a.
Add

b.
Subtraction

c.
Logical Condition

d.
Comparison
This is used to restrict the rows that are returned by a query.
Select one:

a.
Where

b.
Select

c.
Delete

d.
Insert

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’;
Mark 1.00 out of 1.00

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

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’;
Mark 1.00 out of 1.00

True/False Character values are format sensitive and date values


are case sensitive-sensitive.
Answer: False

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;
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;
Mark 1.00 out of 1.00

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’;
Mark 1.00 out of 1.00

窗体底端

You might also like