Oracle Database MySQL 5.6 Developer — Question 16
Using the query:
SELECT Code FROM country WHERE Name = united states
Which statement executed in the mysql client would create a prepared statement?
Answer options
- A. PREPARE STATEMENT countrycode FROM ‘SELECT code FROM counyry WHERE Name =?.;
- B. PREPARE countrycode As ‘SELECT code FROM country WHERE Name =?.;
- C. PREPARE countrycode FROM ‘SELECT code FROM country WHERE Name =?.;
- D. PREPARE STATEMENT countrycode As ‘SELECT code FROM country WHERE Name =?.;
Correct answer: C
Explanation
Option C is correct because it correctly uses the PREPARE statement syntax without any errors. Options A and D incorrectly use 'STATEMENT' which is not required in this context, and A also has a typo in 'counyry'. Option B is incorrect because it uses 'As' instead of 'FROM', which is not the correct syntax for preparing a statement.