Tag: databases

Questions Related to databases

  1. a) DELCARE and BEGIN

  2. b) DECALRE and EXCEPTION

  3. c) EXCEPTION and END

  4. d) BEGIN and END


Correct Option: A,B
  1. a) A stored procedure on the server.

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

  3. c) A standalone procedure on the client machine.

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

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


Correct Option: E

Which is the procedure used to issue User-Defined error messages from stored Sub-Programs?

  1. a) Raise Application procedure

  2. b) Raise Application Error procedure

  3. c) Application Error procedure

  4. d) None of the Above


Correct Option: B
  1. SELECT *

  2. FROM emp

  3. WHERE comm = NULL

  4. There is no error in this statement.


Correct Option: D
  1. a) A comma has been left after the STATS_EXIST_EXCEPTION exception.

  2. b) The STATS_EXIST_EXCEPTION has not been declared as a number.

  3. c) The STATS_EXIST_EXCEPTION has not been declared as an exception.

  4. d) none of the above


Correct Option: C
Explanation:

To understand what prevents this procedure from being created successfully, we need to examine the given procedure. The procedure DELETE_PLAYER takes an input parameter V_IDIN and attempts to delete the corresponding record from the PLAYER table. It also has an exception block that handles the STATS_EXIST_EXCEPTION exception and outputs an error message.

Now, let's go through each option and see if it affects the creation of the procedure:

A. a) A comma has been left after the STATS_EXIST_EXCEPTION exception. This option is incorrect. There is no comma after the STATS_EXIST_EXCEPTION exception, so this cannot be the reason why the procedure cannot be created.

B. b) The STATS_EXIST_EXCEPTION has not been declared as a number. This option is incorrect. The STATS_EXIST_EXCEPTION is not being used as a number, so it does not need to be declared as such. It is being used as an exception.

C. c) The STATS_EXIST_EXCEPTION has not been declared as an exception. This option is correct. The STATS_EXIST_EXCEPTION exception has not been declared in the procedure. Without a declaration, the procedure does not know what to do when the exception is raised. To fix this, the STATS_EXIST_EXCEPTION should be declared as an exception before the BEGIN keyword.

D. d) none of the above This option is incorrect. As explained above, option C is the correct answer.

Therefore, the correct answer is:

The Answer is: C

  1. a) Only local or packaged sub programs can be overloaded.

  2. b) Overloading allows different functions with the same name that differ only in their return types.

  3. c) Overloading allows different subprograms with the same number, type and order of the parameter.

  4. d) Overloading allows different subprograms with the same name and same number or type of the parameters.

  5. e) Overloading allows different subprograms with the same name but different in either number or type or order of parameter.


Correct Option: A,E
  1. a) Packages can be nested.

  2. b) You can pass parameters to packages.

  3. c) A package is loaded into memory each time it is invoked.

  4. d) The contents of packages can be shared by many applications.

  5. e) You can achieve information hiding by making package constructs private.


Correct Option: D,E

Which of the following statements is false with respect to packages?

  1. a) The package itself cannot be called, parameterized, or nested.

  2. b) The format of a package is similar to that of a subprogram.

  3. c) The contents can be shared by many applications once written.

  4. d) None of the above.


Correct Option: D