Consider the following SQL statement. Which of the following could be good ideas for
limiting the amount of data returned by it? (Choose 2)
SELECT * FROM MY_TABLE
[3207,3208]
Correct:
--> If possible within your application, reduce the number of fields retrieved by the query by specifying each field individually as part of the query
--> If possible, add a WHERE clause
Explanation:
The two best tips for optimizing this query are, if possible, to limit the amount of data extracted by it by adding a WHERE clause and specifying the exact fields you want extracted from it. In general, unless otherwise dictated by the circumstances, you should not use SELECT *, both because of the waste of data and because it exposes your application to problems arising from changes in the database structure. This makes answers B and C correct.