0% found this document useful (0 votes)
90 views

Database Management System Final Q1

1. The document describes a database management system final quiz completed by Michelle M. Esperal with full marks. 2. The quiz contains 10 multiple choice questions related to SQL queries on the EMPLOYEES table. 3. The questions test various SQL functions such as SELECT, WHERE, ORDER BY, TRIM, RPAD, LPAD and aggregate functions.

Uploaded by

Michelle Esperal
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)
90 views

Database Management System Final Q1

1. The document describes a database management system final quiz completed by Michelle M. Esperal with full marks. 2. The quiz contains 10 multiple choice questions related to SQL queries on the EMPLOYEES table. 3. The questions test various SQL functions such as SELECT, WHERE, ORDER BY, TRIM, RPAD, LPAD and aggregate functions.

Uploaded by

Michelle Esperal
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/ 12

Database Management System by

Michelle M. Esperal
Final Quiz 1
Completed on Friday, 18 August 2023, 5:01 PM
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1

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

Based on the given SELECT statement below what would be the possible output?
SELECT LASTNAME,SALARY, RPAD(SALARY,4,’@’)
FROM EMPLOYEES
WHERE SALARY BETWEEN 4000 AND 9000
LASTNAME LIKE ‘%S’;

Question 1Select one:


a.
MOURGOS 5800 5800
DAVIES 3100 3100

b.
MOURGOS 5800 5800

c.
MOURGOS 5800 5800@@@@

d.
RAJS 3500 3500
DAVIES 3100 3100
MATOS 2600 2600
VARGAS 2500 2500
HIGGINS 12000 12000

e.
MOURGOS 5800 5800@@@@
RAJS 3500 3500@@@@
DAVIES 3100 3100@@@@
MATOS 2600 2600@@@@
VARGAS 2500 2500@@@@
HIGGINS 12000 12000@@@

Question 2
Question text
This is use to find the numeric position of a named character starting at character position n.

Question 2Select one:

a.
Trim

b.
INSTR

c.
Length

d.
SUBSTR
Question 3
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES

What query should be used in order to display the employees lastname concatenated to
salary. Format the salary column to 6 character long left padded with ‘*’ as special character
for all employees whose manager_id is null or salary between 4000 and 6000 Rename the
column as employees and their Salaries

Question 3Select one:

a.
SELECT (FIRSTNAME||(SALARY,6,'*')) AS "EMPLOYEES AND THEIR SALARIES"
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 AND 6000;

b.
SELECT (FIRSTNAME||RPAD(SALARY,6,'*')) AS "EMPLOYEES AND THEIR SALARIES"
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 AND 6000;

c.
SELECT (FIRSTNAME||RPAD(SALARY,6,'*')) AS "EMPLOYEES AND THEIR SALARIES"
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 OR 6000;

d.
SELECT (FIRSTNAME||RPAD(SALARY,6,'*')) AS "EMPLOYEES AND THEIR SALARIES"
FROM EMPLOYEES
WHERE MANAGER_ID = NULL
OR SALARY BETWEEN 4000 AND 6000;

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

What query should be used in order todisplay the Firstname concatenated to employees
original salary plus concatenate again a new column salary that multiplies the original salary
into three. Rename the column as Dream Salaries.Note sort the salary in descending order.

Question 4Select one:

a.
SELECT (FIRSTNAME||' EARNS '|| SALARY || 'MONTHLY BUT WANTS' || SALARY * 3)
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY;

b.
SELECT (FIRSTNAME||' EARNS MONTHLY BUT WANTS' || SALARY * 3)
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY DESC;

c.
SELECT (FIRSTNAME||' EARNS MONTHLY BUT WANTS' || SALARY * 3)
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY;

d.
SELECT (FIRSTNAME||' EARNS '|| SALARY || 'MONTHLY BUT WANTS' || SALARY * 3)
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY DESC;

Question 5
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT TRIM(‘K’ FROM LASTNAME)AS TRIM, LASTNAME, DEPARTMENT_ID, MANAGER_ID
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 50
AND MANAGER_ID = 100;

Question 5Select one:

a.
RAJS RAJS 50 124

b.
MOURGOS MOURGOS 50 100

c.
ZLOTKEY ZLOTKEY 80 100

d.
ZLOYEY TRINA 80 200

Question 6
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT MOD(SALARY,10) AS “EXCESS SALARY”
FROM EMPLOYEES
WHERE SALARY < 5000;

Question 6Select one:

a.
3
3
3
3
3

b.
3
3
3
3
3
3

c.
0
0
0
0
0

d.
0
0
0
0
0
0

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

What query should be used in order todisplay a report that trim the letter ‘A’ from lastname
of all employees whose department_id between 60 and 90.

Question 7Select one:

a.
SELECT TRIM('A' FROM LASTNAME)
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 90 AND 60;

b.
SELECT TRIM(LASTNAME,’A’)
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 AND 90;

c.
SELECT TRIM('A' FROM LASTNAME)
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 AND 90;

d.
SELECT TRIM('A' FROM LASTNAME)
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 OR 90;

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

What query should be used in order to display the firstname concatenated to salary with
additional column salary that provides a computation of salary * 2. Rename the column as
Increase of all employees whose lastname ends with N.
Question 8Select one:

a.
SELECT (FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE WLL
GOT A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME
LIKE 'N%';

b.
SELECT (FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE WLL
GOT A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME
LIKE '%N';

c.
SELECT (FIRSTNAME || 'SALARY OF' SALARY 'IF MULITPLY BY TWO THEN HE/SHE WLL GOT A
NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE LASTNAME LIKE 'N
%';

d.
SELECT lower(FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE
WLL GOT A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE
LASTNAME LIKE 'N%';

Question 9
Question text
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the salary leftpadded with 15 character long
and ‘$’ as special character and another column salary right padded with 10 character long
with ‘@’ as special character used of all employees in 201, 176 and 144.

Question 9Select one:

a.
SELECT RPAD(SALARY,15,'$'), LPAD(SALARY,10,'@')
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);

b.
SELECT LPAD(SALARY,15,'@'), RPAD(SALARY,10,'$')
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);

c.
SELECT LPAD(SALARY,15,'$'), RPAD(SALARY,10,'@')
FROM EMPLOYEES
WHERE EMPLOYEE_ID = (201,176,144);

d.
SELECT LPAD(SALARY,15,'$'), RPAD(SALARY,10,'@')
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);

Question 10
Question text
This is use to return one result per group of row.

Question 10Select one:

a.
Single row

b.
Dual table

c.
Multiple row

d.
Number function

You might also like