Tag: programming languages

Questions Related to programming languages

Raw types are used to store _________ data.

  1. Binary

  2. Character

  3. ASCII

  4. All of the above


Correct Option: A

SQL has facility for programmed handling of errors that arise during the manipulation of data

  1. TRUE

  2. FALSE

  3. Both

  4. None


Correct Option: B
  1. DELCARE and BEGIN

  2. DECALRE and EXCEPTION

  3. EXCEPTION and END

  4. BEGIN and END


Correct Option: B
  1. It produces the output Procedure B calling C

  2. It produces the output Procedure C calling B

  3. It produces a compilation error because procedure C requires a forward declaration

  4. It produces a compilation error because procedure B requires a forward declaration.


Correct Option: C

You want to create a PL/SQL block of code that calculates discounts on customer orders. This code will be invoked from several places, but only within the program unit ORDERTOTAL. What is the most appropriate location to store the code that calculates the discounts?

  1. a) A stored procedure on the server

  2. b) A block of code in a PL/SQL library.

  3. e) A local subprogram defined within the program unit ORDERTOTAL

  4. d) A block of code in the body of the program unit ORDERTOTAL


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) A stored procedure on the server - This option is incorrect because storing the code in a stored procedure on the server would make it accessible from multiple program units, not just the program unit ORDERTOTAL.

Option B) A block of code in a PL/SQL library - This option is incorrect because storing the code in a PL/SQL library would also make it accessible from multiple program units, not just the program unit ORDERTOTAL.

Option C) A local subprogram defined within the program unit ORDERTOTAL - This option is correct because defining a local subprogram within the program unit ORDERTOTAL ensures that the code is only accessible within that specific program unit. This means that the code for calculating discounts will only be invoked when the ORDERTOTAL program unit is called.

Option D) A block of code in the body of the program unit ORDERTOTAL - This option is incorrect because storing the code directly in the body of the program unit ORDERTOTAL would make it less modular and harder to maintain. It is better to define a separate local subprogram within the program unit for the specific code.

The correct answer is option C. This option is correct because defining a local subprogram within the program unit ORDERTOTAL ensures that the code is only accessible within that specific program unit.

  1. Some DML,PL/SQL statements

  2. All DML,PL/SQL statements

  3. Only PL/SQL statements

  4. None of the Above


Correct Option: C