PrepAway - Latest Free Exam Questions & Answers

Which of the following correctly creates a SQL statement that will insert the values of the $name and $age var

Which of the following correctly creates a SQL statement that will insert the values of the $name
and $age variables into a database? The statement is assigned to the $sqlStmt variable. Assume
a CHAR data type for $name and an INT data type for $age.

PrepAway - Latest Free Exam Questions & Answers

A.
$sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};

B.
$sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name\, $age)};

C.
$sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};

D.
$sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES (\$name\, $age)};


Leave a Reply