Database Oracle Pre-Final Exam and Quizes
Database Oracle Pre-Final Exam and Quizes
Database Oracle Pre-Final Exam and Quizes
: ALTER
: True
Table is known as the collection of data that contains information relevant to an enterprise.
: False
: Semi-Computerized
: Data integrity
: Database instance
: Logical condition
: False
Which of the following is not part of other Comparison Operator?
: <>
: LIKE
: CREATE table
: Data Processing
Database is the term generally used to describe what was done by large mainframe
computers from the late 1940's until the early 1980's.
: False
Security is one of the characteristic of database that includes also the protection of the
database from unauthorized access confidentiality and unauthorized changes.
: False
: DELETE
: Phone_no
Extracts a string of determined length.
: SUBSTR
This is use to find the numeric position of a named character starting at character position n.
: INSTR
: Single row
: Trim
It is a table that is owned by the user SYS and can be accessed by all users.
: Dual
: Number function
: Multiple row
This is use to accept character input and can return both character and number values.
: Character function
This is used to converts the first letter of each word to uppercase and the remaining letters
to lowercase.
: INITCAT
What is the return value if the user try to do the following:
SELECT TRUNC (65.73,-2) FROM DUAL;
:0
*** **
A type of function that accept numeric input and return numeric values
: Number Function
: SINGLE-ROW FUNCTIONS
This query returns rows in the first query that are not present in the second query.
: MINUS
: MULTIPLE-ROW FUNCTIONS
Based on the given SELECT statement below what would be the possible output?
SELECT (LASTNAME||FIRSTNAME), JOB_ID
FROM EMPLOYEES
WHERE SUBSTR (JOB_ID,4)=’REP’;
: ABELELLEN SA_REP
TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
FAYPAT MK_REP
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.
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 AND 90;
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;
:0
0
0
0
0
0
Based on the given SELECT statement below what would be the possible output?
SELECT TRUNC(563.396,-2) FROM DUAL;
: 500
What query should be used in order toget theSUBSTR function that returns the job_id =
‘REP’.
WHERE SUBSTR(JOB_ID,4)='REP';
:9
A type of function that accepts character input and can return both character and number
values.
: CHARACTER FUNCTION
:4
:1
: 8.22
:3
:7
This query returns the rows from both queries after eliminating duplications.
: UNION
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 (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';
This query returns rows from both queries including all duplications
: UNION ALL
Based on the given SELECT statement below what would be the possible output?
SELECT INITCAP(LASTNAME||’,’||FIRSTNAME) AS NAME
FROM EMPLOYEES
WHERE JOB_ID LIKE ’%PR%’;
: King,Steven
Hunold,Alexander
Ernst,Bruce
Lorentz,Diana
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
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 AND 6000;
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’;
: MOURGOS 5800 5800
Based on the given SELECT statement below what would be the possible output?
SELECT TRUNC(563.396,2)FROM DUAL;
: 563.39
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.
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY DESC;
: ZONROX
Based on the given SELECT statement below what would be the possible output?
SELECT TRUNC(563.396,1)FROM DUAL;
: 563.3
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;
: MOURGOS MOURGOS 50 100
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.
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 60 OR JOB_ID LIKE '_T';
A type of function that helps how to group rows in a table into smaller sets and how to
specify search criteria for groups of rows.
: GROUP FUNCTION
What query should be used in order todisplay the firstname and length of firstname rename
the column length of firstname as Number of Character of all employees whose salary is
between 4400 and 8300
FROM EMPLOYEES
WHERE SALARY BETWEEN 4400 AND 8300;
****
Based on the given SELECT statement below what would be the possible output?
SELECT LOWER(LASTNAME||’with a salary of’||SALARY) as Record, LENGTH(LASTNAME) as
Lname
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY IS NULL;
: kingwith a salary of 24000 4
hunoldwith a salary of 2400 6
:1
:5
Based on the given SELECT statement below what would be the possible output?
SELECT FIRSTNAME, SALARY, LPAD(SALARY * 0.10 + SALARY – 100, 8, ‘$’) AS BONUS
FROM EMPLOYEES
WHERE DEPARTMENT_ID NOT IN (10, 110, 50
AND SALARY=17000;
: NENA 17000 $$$18600
LEX 17000 $$$18600
What query should be used in order todisplay the firstname in capitalized format rename
the column as pangalan whose job_id is equal to ‘SA_REP’.
FROM EMPLOYEES
WHERE JOB_ID = 'SA_REP';
: INTERSECT
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.
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);
:3
It combines the results of two or more component queries into one result.
: Set Operators
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
WHERE LASTNAME LIKE 'M%';
-