Header Ads Widget

Responsive Advertisement

Module 03: Writing Executable Statements


Writing Executable Statements



01. What is Lexical Units in a PL/SQL Block?

Lexical units:

a. Are building blocks of any PL/SQL block.

b. Are sequences of characters including letters, digits, tabs, spaces, returns, and symbols.


02. Write down the classification of Lexical Units.

Can be classified as:

a. Identifiers.

b. Delimiters.

c. Literals.

d. Comments.


03. What is Identifiers?

Identifiers are the names given to PL/SQL objects. You have learned to identify valid and invalid identifiers. Recollect that keywords cannot be used as identifiers.

Quoted identifiers are used to: 

a. Make identifiers case sensitive 

b. Include characters such as spaces 

c. Use reserved words


04. What is Delimiters?

Delimiters are symbols that have special meaning. You have already learned that the symbol “;” is used to terminate a SQL or PL/SQL statement. Therefore, “;” is the best example of a delimiter.


05. What is Literals?

Any value that is assigned to a variable is a literal. Any character, number, Boolean, or date value that is not an identifier is a literal.

Literals are classified as:

a. Character literals.

b. Numeric literals.

c. Boolean literals.


06. What is Comments? 

A comment is text that the PL/SQL compiler ignores. Its primary purpose is to document code, Well-placed comments are extremely valuable for code readability and future code maintenance. PL/SQL has both single-line and multiline comments.


07. How we can use the comments?

Comments:

a. Prefix single-line comments with two dashes (--).

b. Place multiple-line comments between the symbols “/*” and “*/”.


08. Write down about SQL Functions in PL/SQL.

SQL functions in PL/SQL:

a. Available in procedural statements:

i. Single-row number.

b. Not available in procedural statements:

i. DECODE.

ii. Group functions.


09. What are the categories of SQL Functions that you can use to manipulate data in PL/SQL?

Categories:

a. Number.

b. Character.

c. Conversion.

d. Date.

e. Miscellaneous.


10. Write down the Programming Guidelines.

Make code maintenance easier by:

a. Documenting code with comments.

b. Developing a case convention for the code.

c. Developing naming conventions for identifiers and other objects.

d. Enhancing readability by indenting.

Post a Comment

0 Comments