0% found this document useful (0 votes)
2K views

DBMS - Quiz 006 - 10 PDF

This document contains a 10 question quiz on SQL queries. Each question provides multiple choice answers for a SQL query and describes the expected output. This quiz is assessing the test-taker's knowledge of different SQL functions such as COUNT, MAX, MIN, SUM, and AVG among others.

Uploaded by

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

DBMS - Quiz 006 - 10 PDF

This document contains a 10 question quiz on SQL queries. Each question provides multiple choice answers for a SQL query and describes the expected output. This quiz is assessing the test-taker's knowledge of different SQL functions such as COUNT, MAX, MIN, SUM, and AVG among others.

Uploaded by

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

Home My courses CS-350-LEC-1913T Week 13: Short Quiz Quiz 006



Question 1 Which of the following query is correct which will display the
 Not yet same output as shown below?
answered
 Marked out of
1.00

 

Select one:
a. SELECT COUNT(*) FROM EMPLOYEES;

b. SELECT COUNT ALL FROM EMPLOYEES;

c. SELECT * FROM EMPLOYEES;

Clear my choice

Question 2  
Not yet
answered

Marked out of
1.00

SELECT COUNT(PRICE) FROM STOCKS;

Answer: 9
Question 3 Which of the following query is correct which will display the
Not yet same output as shown below?
answered

Marked out of
 1.00


Select one:

a. SELECT MAX(FIRSTNAME), MANAGER_ID, COUNT(SALARY),
AVG(SALARY)
 FROM EMPLOYEES
WHERE SALARY BETWEEN 6000 AND 10000

GROUP BY MANAGER_ID
 HAVING (SALARY) >= 5000;

b. SELECT MAX(FIRSTNAME), MANAGER_ID, COUNT(SALARY),


AVG(SALARY)
FROM EMPLOYEES
GROUP BY MANAGER_ID

WHERE SALARY BETWEEN 6000 AND 10000


HAVING MIN(SALARY) >= 5000;

c. SELECT MAX(FIRSTNAME), MANAGER_ID, COUNT(SALARY),


AVG(SALARY)
FROM EMPLOYEES
WHERE SALARY BETWEEN 10000 AND 6000
GROUP BY MANAGER_ID
HAVING MIN(SALARY) >= 5000;

d. SELECT MAX(FIRSTNAME), MANAGER_ID, COUNT(SALARY),


AVG(SALARY)
FROM EMPLOYEES
WHERE SALARY BETWEEN 6000 AND 10000

HAVING MIN(SALARY) >= 5000


GROUP BY MANAGER_ID;

Clear my choice

Question 4

Not yet
answered

Marked out of
1.00

SELECT MIN(PRICE) FROM STOCKS;

Answer: 7
Question 5
Not yet
answered

Marked out of
 1.00

SELECT SUM(QTY) FROM STOCKS WHERE WAREHOUSE IN (1,5) GROUP



BY WAREHOUSE HAVING MAX(WAREHOUSE) >=5;


Answer: 1
Question 6 Choose the letter of the correct answer based on the table
Not yet EMPLOYEES as shown below.
answered
Table 1.0 EMPLOYEES
Marked out of
 1.00


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:
a. SELECT MAX(LASTNAME||FIRSTNAME) AS "EMPLOYEES NAME",
JOB_ID, COUNT(JOB_ID)
FROM EMPLOYEES

GROUP BY JOB_ID
WHERE LASTNAME LIKE '%N'

HAVING AVG(SALARY)>10000;

b. SELECT MAX(LASTNAME||FIRSTNAME) AS "EMPLOYEES NAME",


JOB_ID, COUNT(JOB_ID)
FROM EMPLOYEES
WHERE LASTNAME LIKE '%N'
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;

c. SELECT MAX(LASTNAME||FIRSTNAME) AS EMPLOYEES NAME,


JOB_ID, COUNT(JOB_ID)
FROM EMPLOYEES

WHERE LASTNAME LIKE '%N'


GROUP BY JOB_ID

HAVING AVG(SALARY)>10000;

d. SELECT MAX(LASTNAME||FIRSTNAME) AS "EMPLOYEES NAME",


JOB_ID, COUNT(JOB_ID)
FROM EMPLOYEES
WHERE LASTNAME LIKE '%N'
GROUP BY JOB_ID
HAVING AVG(SALARY)<10000;

Clear my choice
Question 7

Not yet
answered

Marked out of
 1.00

SELECT COUNT (AVG(PRICE)) FROM STOCKS GROUP BY



WAREHOUSE;


Answer: 6

Question 8 Which of the following query is correct which will display the
Not yet same output as shown below?
answered

Marked out of
1.00

Select one:
a. SELECT JOB_ID, COUNTDISTINCT(JOB_ID)"NO. OF JOB_ID",
SUM(SALARY), AVG(SALARY)
FROM EMPLOYEES

GROUP BY JOB_ID;

b. SELECT JOB_ID, COUNT*(JOB_ID)"NO. OF JOB_ID",


SUM(SALARY), AVG(SALARY)
FROM EMPLOYEES

GROUP BY JOB_ID;

c. SELECT JOB_ID, COUNT(JOB_ID)"NO. OF JOB_ID",


SUM(SALARY), AVG(SALARY)
FROM EMPLOYEES
GROUP BY JOB_ID;

d. SELECT JOB_ID, COUNT(JOB_ID)"NO. OF JOB_ID",


SUM(SALARY), AVG(SALARY)
FROM EMPLOYEES;

Clear my choice
Question 9 Which of the following query is correct which will display the
Not yet same output as shown below?
answered

Marked out of
 1.00


Select one:

a. SELECT MIN(LASTNAME||FIRSTNAME) AS NAME,
DEPARTMENT_ID

FROM EMPLOYEES

 WHERE DEPARTMENT_ID IN(90,50)

HAVING MIN(DEPARTMENT_ID)<=90;

b. SELECT MIN(LASTNAME||FIRSTNAME) AS NAME,

DEPARTMENT_ID
FROM EMPLOYEES

WHERE DEPARTMENT_ID IN(90,50)


GROUP BY DEPARTMENT_ID

HAVING MIN(DEPARTMENT_ID)<=90;

c. SELECT MIN(LASTNAME||FIRSTNAME) AS NAME,


DEPARTMENT_ID
FROM EMPLOYEES

GROUP BY DEPARTMENT_ID
WHERE DEPARTMENT_ID IN(90,50)
HAVING MIN(DEPARTMENT_ID)<=90;

d. SELECT MIN(LASTNAME||FIRSTNAME) AS NAME,


DEPARTMENT_ID
FROM EMPLOYEES
WHERE DEPARTMENT_ID IN(90,50)
GROUP BY DEPARTMENT_ID

HAVING(DEPARTMENT_ID)<=90;

Clear my choice

Question 10

Not yet
answered

Marked out of
1.00

SELECT AVG(NVL(QTY,0)) FROM STOCKS;

Answer: 8.22


Stay in touch

AMA EDUCATION SYSTEM
  https://blended.amauonline.com/helpdesk

You might also like