Database [3i Infotech Placement]: Sample Questions 125 - 125 of 294

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 125

Database

Question

MCQ▾

Which of the following is NOT VALID as PL/SQL

Choices

Choice (4)

a.

NUM1, NUM2 number;

b.

date1 date:= sysdate

c.

Bool boolean;

d.

deptname dept. dname % type;

Answer

d.

Explanation

Structure of PL/SQL Engine and PL/SQL Block
  • The name of a PL/SQL variable consists of one of more letters and numerals. Dollar sign and number sign is not valid in PL/SQL.
  • Boolean values are single byte data type, either TRUE or FALSE or NULL () .
  • A variable is nothing but a name given to a storage area that programs can manipulate.
  • Every variable in PL/SQL has a specific data type, which defines size and layout of variable՚s memory, the range of value it stores and set of operations that can be applied to the variable.
  • By default, variable names are not case-sensitive.
  • We cannot use a reserved PL/SQL keyword as a variable name.
  • PL/SQL variables are declared in the declaration section.
  • When we declare a variable, PL/SQL allocates the memory for the variable՚s value and the storage location is identified by the variable name.

Syntax for declaring a variable:

  • Variable_name [CONSTANT] datatype [NOT NULL] [:= | DEFAULT initial_value]
  • Here, variable_name is a valid identifier in PL/SQL.
  • Datatype must be a valid PL/SQL data type defined data type

Developed by: