- Home
- Database
- Oracle 12 C
- OCA Oracle 12 C SQl Fundamentals(1Z0-061)
11.
You issue the following query:
SELECT salary "Employee Salary"
FROM employees;
How will the column heading appear in the result?
SELECT salary "Employee Salary"
FROM employees;
How will the column heading appear in the result?
- A.EMPLOYEE SALARY
- B.EMPLOYEE_SALARY
- C.Employee Salary
- D.employee_salary
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
Column alias names enclosed in quotation marks will appear as typed. Spaces and mixed case appear in the column alias name only when the alias is enclosed in double quotation marks. |
12.
The EMP table is defined as follows:
You perform the following two queries:
1. SELECT empno enumber, ename FROM emp ORDER BY 1;
2. SELECT empno, ename FROM emp ORDER BY empno ASC;
Which of the following is true?

1. SELECT empno enumber, ename FROM emp ORDER BY 1;
2. SELECT empno, ename FROM emp ORDER BY empno ASC;
Which of the following is true?
- A.Statements 1 and 2 will produce the same result in data.
- B.Statement 1 will execute; statement 2 will return an error.
- C.Statement 2 will execute; statement 1 will return an error.
- D.Statements 1 and 2 will execute but produce different results.
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
Statements 1 and 2 will produce the same result. You can use the column name, column alias, or column position in the ORDER BY clause. The default sort order is ascending. For a descending sort, you must explicitly specify that order with the DESC keyword. |
13.
You issue the following SELECT statement on the below EMP table.
SELECT (200+((salary*0.1)/2)) FROM emp;
What will happen to the result if all the parentheses are removed?

What will happen to the result if all the parentheses are removed?
- A.No difference, because the answer will always be NULL.
- B.No difference, because the result will be the same.
- C.The result will be higher.
- D.The result will be lower.
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
In the arithmetic evaluation, multiplication and division have precedence over addition and subtraction. Even if you do not include the parentheses, salary*0.1 will be evaluated first. The result is then divided by 2, and its result is added to 200. |
14.
In the following SELECT statement, which component is a literal? (Choose all that apply.)
SELECT 'Employee Name: ' || ename
FROM emp WHERE deptno = 10;
SELECT 'Employee Name: ' || ename
FROM emp WHERE deptno = 10;
- A.10
- B.ename
- C.Employee Name:
- D.||
- Answer & Explanation
- Report
Answer : [A, C]
Explanation :
Explanation :
Character literals in the SQL statement are enclosed in single quotation marks. Literals are concatenated using ||. Employee Name: is a character literal, and 10 is a numeric literal. |
15.
What will happen if you query the EMP table shown in question 2 with the following?
SELECT empno, DISTINCT ename, salary
FROM emp;
SELECT empno, DISTINCT ename, salary
FROM emp;
- A.EMPNO, unique values of ENAME, and then SALARY are displayed.
- B.EMPNO and unique values of the two columns, ENAME and SALARY, are displayed.
- C.DISTINCT is not a valid keyword in SQL.
- D.No values will be displayed because the statement will return an error.
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
DISTINCT is used to display a unique result row, and it should follow immediately after the keyword SELECT. Uniqueness is identified across the row, not by a single column. |