Dbms 1
Dbms 1
Answer:
Which of the following query is correct which will display the same output as shown below?
FROM EMPLOYEES;
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
FROM EMPLOYEES
This is use to find the numeric position of a named character starting at character position n.
INSTR
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.
FROM EMPLOYEES
b.
SELECT COUNT(JOB_ID), AS “TOTAL NO. OF ST_CLERK”
FROM EMPLOYEES
c.
FROM EMPLOYEES
d.
FROM EMPLOYEES
What query should be used in order toget theSUBSTR function that returns the job_id = ‘REP’.
Select one:
a.
b.
WHERE SUBSTR=’REP’;
c.
WHERE SUBSTR(JOB_ID,4)=’REP’;
d.
WHERE SUBSTR(JOB_ID,4)=’%REP%’;
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);
b.
SELECT MIN(FIRSTNAME||LASTNAME)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY)<10000;
c.
SELECT MIN(FIRSTNAME,LASTNAME)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY)<10000;
d.
SELECT MIN(FIRSTNAME||LASTNAME)
FROM EMPLOYEES
HAVING MAX(SALARY)<10000
GROUP BY DEPARTMENT_ID;
Which of the following query is correct which will display the same output as shown below?
Select one:
a.
b.
c.
d.
Based on the given SELECT statement below what would be the possible output?
AND SALARY=17000;
Select one:
a.
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.
Select one:
a.
AS “DREAM SALARIES”
FROM EMPLOYEES
It is a table that is owned by the user SYS and can be accessed by all users.
Dual
Based on the given SELECT statement below what would be the possible output?
Select one:
a.
563.39
What query should be used in order to display the employees lastname concatenated with firstname
and with a ‘, (comma)’ in between. A rename on the concatenated column as Complete Name. Note all
values in Complete Name column should be in lowercase plus display the length of employees lastname
for all employees whose lastname starts with letter M sort the lastname in its default order.
LENGTH(LASTNAME)
FROM EMPLOYEES
Answer:
PALMOLIVE
Based on the given SELECT statement below what would be the possible output?
Select one:
a.
500
Answer:
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:
FROM EMPLOYEES;
Single row
Answer:
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.
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;
This is use to accept character input and can return both character and number values
Character function
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.
Select 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’;
Answer:
27
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
ABELELLEN SA_REP
TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
FAYPAT MK_REP
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.
FROM EMPLOYEES;
Number function
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
Select one:
a.
FROM EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
563.3
SELECT SUM(QTY) FROM STOCKS WHERE WAREHOUSE IN (1,5) GROUP BY WAREHOUSE HAVING
MAX(WAREHOUSE) >=5;
Answer:
FROM INVENTORY;
Which of the following query is correct which will display the same output as shown below?
FROM 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.
FROM EMPLOYEES
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;
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.
SELECT TRIM(LASTNAME,’A’)
FROM EMPLOYEES
Which of the following query is correct which will display the same output as shown below?
a.
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
Which of the following query is correct which will display the same output as shown below?
FROM EMPLOYEES
GROUP BY JOB_ID;
Which of the following query is correct which will display the same output as shown below?
Which of the following query is correct which will display the same output as shown below?
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
What query should be used in order to display the lastname and salary of all employees whose
department_id = 60 or job_id like ‘_T%’. Format the salary to be 15 character long, left padded with ‘$’
as special character. Label the column Salary.
Select one:
a.
FROM EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 50
Answer:
Which of the following query is correct which will display the same output as shown below?
SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
This is used to converts the first letter of each word to uppercase and the remaining letters to
lowercase.
INITCAT
Trim
Which of the following query is correct which will display the same output as shown below?
Based on the given SELECT statement below what would be the possible output?
King,Steven
Hunold,Alexander
Ernst,Bruce
Lorentz,Diana
Based on the given SELECT statement below what would be the possible output?
FROM EMPLOYEES
Answer:
3
SELECT AVG(NVL(QTY,0)) FROM STOCKS;
Answer:
8.22