Font size
WorksheetsLesson 4 - Fundamentals of Database Systems
Total questions: 25
Worksheet time: 13mins
Character and date literals must be enclosed in double quotation marks.
True
False
What are the function/s that are not available in procedural statements?
Miscellaneous functions
Data-type conversions
DECODE
Group functions
v_emp_name:= v_first_name|' '|v_last_name;
Is this how you concatenate variables?
Yes
No
TRUNC is a valid date function in PL/SQL
True
False
v_new_date := ADD_MONTHS(SYSDATE,v_num_months);
This is how you add months to a current date.
True
False
It is where the PL/SQL attempts to convert data types
dynamically if they are mixed in a statement.
Implicit Conversions
Explicit Conversions
It converts values from one data type to
another by using built-in functions.
Implicit Conversions
Explicit Conversions
It is strongly recommended that you AVOID allowing SQL or
PL/SQL to perform explicit conversions on your behalf.
True
False
The operations within an expression are performed in a
particular order depending on their precedence(priority).
True
False
What is the highest priority in the default order of operations?
**
/
+
AND
What is the lowest priority in the default order of operations?
+
=
NULL
OR
The basic units (procedures, functions, and anonymous blocks) are logical blocks, which can contain any number of nested sub-blocks.
True
False
These are blocks of code placed within other
blocks of code.
Variable Scope
Nested Blocks
PL/SQL Blocks
Unnested Blocks
It is where the block or blocks in which the
variable is accessible, that is, where it can be used.
Variable scope
Nested Blocks
PL/SQL Blocks
Lexical Blocks
If PL/SQL does not find the variable declared locally, it looks
downward into the child blocks.
True
False
You can declare variables with the same name in two different blocks when one block is nested within the other block.
True
False
It is a label given to a block.
Identifier
Variable
Block Name
Qualifier
What if the same name is used for two variables, one in each of the blocks?
Put a qualifier block in the outer block so that it can be called if it will be the block that will be used.
Add a function to the outer block so that it can be called if it will be the block that will be used.
The inner block will be read instead of the outer block.
Use implicit data type conversions because explicit data
type conversions can be slower and the rules can change
in later software releases.
True
False
What are the good programming practices demonstrated and/or discussed:
Avoid ambiguity when choosing identifiers.
Use the %TYPE attribute to declare a variable
Declare two variables or constant identifier per line for
better readability and code maintenance.
Use the NULL constraint when declaring a variable
that must hold a value.
Identifiers, tables, and columns should be written in ____ based on the guidelines.
Uppercase
Lowercase
Any of the two
The naming of identifiers should be:
consistent
clear
inconsistent
ambigous
unambigous
Programming guidelines include:
Documenting code without comments
Developing a case convention for the code
Developing naming conventions only for identifiers
Enhancing readability by indenting
PL/SQL keyword are written in ______ based on the guidelines.
Uppercase
Lowercase
Any of the two
Data types are written in _______ based on the guidelines.
Uppercase
Lowercase
Any of the two
