100% found this document useful (1 vote)
4K views

Database Management System Midterm Quiz 2

The document provides several multiple choice questions about SQL queries on a PARTS table. This includes questions about selecting specific columns, filtering rows by criteria like class or price ranges, sorting results, and using operators like BETWEEN, LIKE and NOT. The correct answers to each question are chosen from the lettered options based on the sample PARTS table structure and contents.

Uploaded by

Santi Seguin
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
100% found this document useful (1 vote)
4K views

Database Management System Midterm Quiz 2

The document provides several multiple choice questions about SQL queries on a PARTS table. This includes questions about selecting specific columns, filtering rows by criteria like class or price ranges, sorting results, and using operators like BETWEEN, LIKE and NOT. The correct answers to each question are chosen from the lettered options based on the sample PARTS table structure and contents.

Uploaded by

Santi Seguin
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/ 6

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;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy