ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

Which command is used for showing current date and time in Mysql command line tool?

Answer & Solution
Correct Answer: Option A
To display the current date and time in MySQL command line tool, the correct command is to use the SELECT statement with the NOW() function.

Let's analyze each option:
Option A: select now(): This option is correct. By using the SELECT statement followed by the NOW() function, you can retrieve the current date and time in MySQL.
Option B: SELECT time(): This option is incorrect. The TIME() function is used to extract the time part from a datetime expression, but it doesn't display the current date and time on its own.
Option C: SELECT currenttime(): This option is incorrect. There is no function named CURRENTTIME() in MySQL. The correct function to use for the current date and time is NOW().
Option D: None of the mentioned: This option is incorrect as there is a suitable command available to display the current date and time in MySQL command line tool.

Therefore, the correct answer is Option A: select now(), as it accurately represents the command used to show the current date and time in MySQL command line tool.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.