Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a PL/SQL block that includes declarations for the following variables: A v

ID: 652164 • Letter: W

Question

Write a PL/SQL block that includes declarations for the following variables:

A varchar2 datatype that can contain "ITM108 Intro to Databases and PLSQL"

a number that can be assigned 987654.55, but not 987654.567 nor 9876543.55

a constant (you choose the correct data type) that is auto-initialized to "Dave"

A boolean

A data data type autoinitialized to a month from the day you do this assignment.

In the body of the Pl/SQL block put a DBMS_output.put_line message for each of the variables that received an autoinitialization value.

In a comment at the bottom of the PL/SQL block, state the value of the number data type.

Explanation / Answer

DECLARE
   title VARCHAR2(35);
   num NUMBER(8,2);
   author CONSTANT VARCHAR2(6) := "Dave";
   boolValue BOOLEAN;
   startDate DATE := TO_DATE ('11-1-2015','mm-dd-yyyy');
BEGIN
   dbms_output.put_line('Author ' || author);
   dbms_output.put_line('Assignment start date ' || startDate);
   -- value of number data type is 987654.55
END;
/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote