Tag: databases

Questions Related to databases

  1. convert 10 to 'TEN'

  2. convert '10' to 10

  3. convert '10' to '10'

  4. convert 'TEN' to 10


Correct Option: C
  1. The indexed column is declared as NOT NULL.

  2. The indexed columns are used in the FROM clause.

  3. The indexed columns are part of an expression.

  4. The indexed column contains a wide range of values.


Correct Option: D
  1. SELECT TO_CHAR(2000, '$#,###.##') from dual

  2. SELECT TO_CHAR(2000, '$0,000.00') from dual

  3. SELECT TO_CHAR(2000, '$9,999.00') from dual

  4. SELECT TO_CHAR(2000, '$9,999.99') from dual

  5. SELECT TO_CHAR(2000, '$2,000.00') FROM dual;

  6. SELECT TO_CHAR(2000, '$N,NNN.NN') FROM dual;


Correct Option: B,C,D
  1. It returns a single result row based on single rows

  2. It returns a single result row based on groups of rows

  3. It can only appear in ORDER BY clauses

  4. It cannot appear in select lists


Correct Option: B
  1. SELECT ABS(-33) "Absolute" FROM DUAL;

  2. SELECT ABS(-33), Absolute FROM DUAL;

  3. SELECT ABS("-33") Absolute FROM DUAL;

  4. None of these


Correct Option: A
Explanation:

To solve this question, the user needs to know the syntax for calculating the absolute value in SQL. The ABS function can be used to calculate the absolute value of a number.

Now, let's go through each option and explain why it is right or wrong:

A. SELECT ABS(-33) "Absolute" FROM DUAL; This option is correct. The ABS function is used to calculate the absolute value of a number, and the syntax in this statement is correct. The "Absolute" alias is used to rename the column with the calculated value.

B. SELECT ABS(-33), Absolute FROM DUAL; This option is incorrect. The "Absolute" alias is not defined in the statement. Additionally, the ABS function is used correctly.

C. SELECT ABS("-33") Absolute FROM DUAL; This option is incorrect. The quotation marks around the number indicate that it is a string, not a number. The ABS function cannot calculate the absolute value of a string.

D. None of these This option is incorrect. Option A is the correct answer.

The Answer is: A

  1. it has a syntax error, the AVG clause is not valid

  2. it calculates the average of the maximum salaries of all the departments

  3. it has a syntax error, the MAX clause is not valid

  4. it has no error, but the GROUP BY clause is not effective


Correct Option: B
  1. COMMIT

  2. MERGE

  3. UPDATE

  4. DELETE

  5. CREATE

  6. DROP


Correct Option: A,B,C,D

Which Function can return a non-Null value if passed null arguments?

  1. NULLIF

  2. LENGTH

  3. CONCAT

  4. INSTR

  5. TAN


Correct Option: C