Which of the following lines of code is syntactically correct?
a. DECLARE order NUMBER; departure DATE; BEGIN ---- executable statements --- END
b. DECLARE order NUMBER; departure DATE BEGIN ---- executable statements --- END
c. DECLARE order NUMBER(3); departure DATE; BEGIN ---- executable statements --- END;
d. DECLARE order NUMBER(2); departure DATE; BEGIN; ---- executable statements --- END

Respuesta :

Answer:

The answer is:

c.  

DECLARE

order NUMBER(3);

departure DATE;

BEGIN

---- executable statements ---

END;

Explanation:

SQL Commands must close with a semicolon to be correctly parsed by the server. This is the cause why the syntax is wrong in:

A. DATE; BEGIN ---- executable statements --- END lacks semicolon in END.

B. DECLARE order NUMBER; departure DATE lacks semicolon after DATE.

D. A. DATE; BEGIN ---- executable statements --- END lacks semicolon in END.

ACCESS MORE
EDU ACCESS