0% found this document useful (0 votes)
272 views22 pages

Final Quiz 1 and 2 Dmbs

This document contains the results of a 10 question SQL quiz taken on January 21, 2021. The quiz took 8 minutes to complete and the participant scored 10/10 (100%). Each question asked the user to identify the correct SQL query out of 4 options to display or manipulate data from the provided EMPLOYEES table.
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)
272 views22 pages

Final Quiz 1 and 2 Dmbs

This document contains the results of a 10 question SQL quiz taken on January 21, 2021. The quiz took 8 minutes to complete and the participant scored 10/10 (100%). Each question asked the user to identify the correct SQL query out of 4 options to display or manipulate data from the provided EMPLOYEES table.
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/ 22

Started on Thursday, 21 January 2021, 3:39 PM

State Finished
Completed on Thursday, 21 January 2021, 3:47 PM
Time taken 8 mins
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?

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

Question 2
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?
Select one:
a. SELECT MIN(LOWER(FIRSTNAME||' surnname is '||LASTNAME)) AS "COMPLETE
NAME", MIN(MANAGER_ID) AS "LOWEST MANAGER_ID" FROM EMPLOYEES;
b. SELECT MIN(initcap(FIRSTNAME||' surnname is '||LASTNAME)) AS "COMPLETE
NAME", MIN(MANAGER_ID) AS "LOWEST MANAGER_ID" FROM EMPLOYEES;
c. SELECT MIN(initcap(FIRSTNAME||' surnname is '||LASTNAME)) AS COMPLETE
NAME, MIN(MANAGER_ID) AS "LOWEST MANAGER_ID" FROM EMPLOYEES;
d. SELECT MIN(LOWER(FIRSTNAME||surnname is ||LASTNAME)) AS "COMPLETE
NAME", MIN(MANAGER_ID) AS "LOWEST MANAGER_ID" FROM EMPLOYEES;

Question 3
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES
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;

Question 4
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES

Which of the following is the correct query that display the Minimum firstname
concatenated to lastname? Look for the maximum salary that is less than 10000
per department_id.
Select one:
a. SELECT MIN(FIRSTNAME||LASTNAME)

FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY)<10000;

b. SELECT MIN(FIRSTNAME||LASTNAME)

FROM EMPLOYEES
HAVING MAX(SALARY)<10000
GROUP BY DEPARTMENT_ID;
c. SELECT MIN(FIRSTNAME,LASTNAME)

FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY)<10000;

d. SELECT MIN(FIRSTNAME||LASTNAME)

FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY);

Question 5
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES

Which of the following is the correct query that displays the maximum salary?
Select one:
a. SELECT COUNT (MAX(SALARY)) FROM EMPLOYEES;
b. SELECT COUNT (DISCTINCT MAX(SALARY)) FROM EMPLOYEES;
c. SELECT MAX(SALARY) FROM EMPLOYEES;
d. SELECT MAX SALARY FROM EMPLOYEES;

Question 6
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES

Which of the following is the correct query that displays the MINIMUM salary of
employees per job_id? Note job_id should be in lowercase.
Select one:
a. SELECT MIN(SALARY) AS LOWEST SALARY, LOWER(JOB_ID)

FROM EMPLOYEES;

b. SELECT MIN(SALARY) AS “LOWEST SALARY”, LOWER(JOB_ID)


FROM EMPLOYEES
GROUP BY JOB_ID;

c. SELECT MIN(SALARY) AS “LOWEST SALARY”, LOWER(JOB_ID)

FROM EMPLOYEES;

d. SELECT MIN(SALARY) AS LOWEST SALARY, LOWER(JOB_ID)

FROM EMPLOYEES
GROUP BY JOB_ID;

Question 7
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES

Which of the following is the correct query that displays the lowest salary
rename as “LOWEST SALARY”, maximum salary rename as “HIGHEST SALARY”
and department_id concatenated to job_id?
Select one:
a. SELECT CONCAT(DEPARTMENT_ID,JOB_ID),MIN(SALARY), MAX(SALARY)

FROM EMPLOYEES
GROUP BY DEPARTMENT_ID;

b. SELECT CONCAT(DEPARTMENT_ID,JOB_ID),MIN(SALARY), MAX(SALARY)

FROM EMPLOYEES
GROUP BY JOB_ID,DEPARTMENT_ID;

c. SELECT CONCAT(DEPARTMENT_ID,JOB_ID),MIN(SALARY), MAX(SALARY)

FROM EMPLOYEES
GROUP BY JOB_ID;

d. SELECT CONCAT(DEPARTMENT_ID,JOB_ID),MIN(SALARY), MAX(SALARY)

FROM EMPLOYEES;

Question 8
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?

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

FROM EMPLOYEES
WHERE DEPARTMENT_ID IN(90,50)
GROUP BY DEPARTMENT_ID
HAVING(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
WHERE DEPARTMENT_ID IN(90,50)
HAVING MIN(DEPARTMENT_ID)<=90;

d. 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;

Question 9
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?

Select one:
a. 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;

b. 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;

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

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

d. 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;

Question 10
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?
Select one:
a. SELECT COUNT(DISTINCT MANAGER_ID) AS NO. OF MANAGER_ID FROM
EMPLOYEES;
b. SELECT COUNT(MANAGER_ID) AS "NO. OF MANAGER_ID" FROM EMPLOYEES;
c. SELECT COUNT *(DISTINCT MANAGER_ID) AS "NO. OF MANAGER_ID" FROM
EMPLOYEES;
d. SELECT COUNT(DISTINCT MANAGER_ID) AS "NO. OF MANAGER_ID" FROM
EMPLOYEES;

Started on Thursday, 21 January 2021, 3:48 PM


State Finished
Completed on Thursday, 21 January 2021, 3:52 PM
Time taken 4 mins 44 secs
Marks 8.00/10.00
Grade 80.00 out of 100.00
Question 1
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES
Which of the following is the correct report that display the smallest (minimum)
Surname.. and apply the ff. functions:
 Get the average salary; Group the data per job_id; Get
only job_id with a keyword “REP”; and Apply having
clause, which the max salary per job_id is greater than
5000.

Select one:
a. SELECT MIN(LASTNAME), AVG(SALARY)

FROM EMPLOYEES
GROUP BY JOB_ID
WHERE JOB_ID LIKE ‘%REP%’
HAVING MAX(SALARY)>500;

b. SELECT MIN(LASTNAME), AVG(SALARY)

FROM EMPLOYEES
WHERE JOB_ID LIKE ‘%REP%’
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;

c. SELECT CONCAT(DEPARTMENT_ID,JOB_ID),MIN(SALARY), MAX(SALARY)

FROM EMPLOYEES
GROUP BY JOB_ID;
d. SELECT MIN(LASTNAME), AVG(SALARY)

FROM EMPLOYEES
WHERE JOB_ID NOT LIKE ‘%REP%’
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;

Question 2
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES

Which of the following is the correct query that displays the MINIMUM salary of
employees per job_id? Note job_id should be in lowercase.
Select one:
a. SELECT MIN(SALARY) AS LOWEST SALARY, LOWER(JOB_ID)

FROM EMPLOYEES;
b. SELECT MIN(SALARY) AS “LOWEST SALARY”, LOWER(JOB_ID)

FROM EMPLOYEES
GROUP BY JOB_ID;

c. SELECT MIN(SALARY) AS “LOWEST SALARY”, LOWER(JOB_ID)

FROM EMPLOYEES;

d. SELECT MIN(SALARY) AS LOWEST SALARY, LOWER(JOB_ID)

FROM EMPLOYEES
GROUP BY JOB_ID;

Question 3
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?

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

Question 4
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES

Which of the following is the correct query that displays the minimum lastname?
Select one:
a. SELECT MIN(LASTNAME) FROM EMPLOYEES;
b. SELECT COUNT (DISCTINCT MIN(LASTNAME)) FROM EMPLOYEES;
c. SELECT COUNT (MIN(LASTNAME)) FROM EMPLOYEES;
d. SELECT MIN LASTNAME FROM EMPLOYEES;

Question 5
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that displays the maximum salary?
Select one:
a. SELECT MAX SALARY FROM EMPLOYEES;
b. SELECT COUNT (MAX(SALARY)) FROM EMPLOYEES;
c. SELECT MAX(SALARY) FROM EMPLOYEES;
d. SELECT COUNT (DISCTINCT MAX(SALARY)) FROM EMPLOYEES;

Question 6
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?

Select one:
a. 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;

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

FROM EMPLOYEES
WHERE DEPARTMENT_ID IN(90,50)
HAVING MIN(DEPARTMENT_ID)<=90;

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

FROM EMPLOYEES
WHERE DEPARTMENT_ID IN(90,50)
GROUP BY DEPARTMENT_ID
HAVING(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 MIN(DEPARTMENT_ID)<=90;

Question 7
Complete
Mark 0.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES
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;

Question 8
Complete
Mark 0.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that counts the number of ST_CLERK
job_id? Rename the column as “Total no. of ST_CLERK”.
Select one:
a. SELECT COUNT(JOB_ID), AS TOTAL NO. OF ST_CLERK

FROM EMPLOYEES
WHERE JOB_ID = ‘ST_CLERK’;

b. SELECT COUNT(JOB_ID), AS “TOTAL NO. OF ST_CLERK”

FROM EMPLOYEES
WHERE JOB_ID = ‘ST_CLERK’;

c. SELECT COUNT * (JOB_ID), AS “TOTAL NO. OF ST_CLERK”

FROM EMPLOYEES
WHERE JOB_ID = ‘ST_CLERK’;

d. SELECT COUNT(JOB_ID), AS “TOTAL NO. OF ST_CLERK”

FROM EMPLOYEES
WHERE JOB_ID != ‘ST_CLERK’;

Question 9
Complete
Mark 1.00 out of 1.00
Flag question

Question text

Which of the following query is correct which will display the same output as
shown below?

Select one:
a. SELECT MAX(LASTNAME||FIRSTNAME) AS NAME, MAX(SALARY)

FROM EMPLOYEES;

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

FROM EMPLOYEES;

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

FROM EMPLOYEES;

d. SELECT MAX(LASTNAME||','||FIRSTNAME) AS NAME, MAX(SALARY)

FROM EMPLOYEES;

Question 10
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Choose the letter of the correct answer based on the table EMPLOYEES as shown
below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that display the Job_id and add the ff:
function:
 Count the total number of job_id per distinct values;
Compute for the summary of salary per job_id; and
Compute for the average salary per job_id

Select one:
a. SELECT DISTINCT(JOB_ID), COUNT(JOB_ID) AS “NO. OF JOB_ID”, SUM(SALARY)
AS “TOTAL SALARY”, AVG(SALARY) AS “AVERAGE SALARY” FROM
EMPLOYEES GROUP BY JOB_ID;
b. SELECT COUNT (DISTINCT(JOB_ID) AS “NO. OF JOB_ID”, SUM(SALARY) AS
“TOTAL SALARY”, AVG(SALARY) AS “AVERAGE SALARY” FROM EMPLOYEES GROUP
BY JOB_ID;
c. SELECT DISTINCT(JOB_ID), COUNT * (JOB_ID) AS “NO. OF JOB_ID”,
SUM(SALARY) AS “TOTAL SALARY”, AVG(SALARY) AS “AVERAGE SALARY” FROM
EMPLOYEES GROUP BY JOB_ID;
d. SELECT DISTINCT(JOB_ID), COUNT(JOB_ID) AS “NO. OF JOB_ID”, SUM(SALARY)
AS “TOTAL SALARY”, AVG(SALARY) AS “AVERAGE SALARY” FROM EMPLOYEES;

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