Machine-translated by Google. Questions are authored in English.
Top

Discussion

In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:

  • A.all columns of the table are to be returned.
  • B.all records meeting the full criteria are to be returned.
  • C.all records with even partial criteria met are to be returned.
  • D.None of the above is correct.

Answer: A

Correct answer: all columns of the table are to be returned.

The asterisk is shorthand in the SELECT list, standing for every column of the source in the order the table defines them. It says nothing about which rows come back - that is the WHERE clause's work, and the other options describe row filtering.

Convenient as it is, SELECT * is poor practice in application code: adding a column to the table silently changes the result set, and the query fetches data the program does not use. Naming the columns explicitly avoids both.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.