Examveda

What column names are displayed when this SQL command is executed?
SHOW COLUMNS FROM tbl_name LIKE '%name';

A. suffixed with 'name'

B. prefixed with 'name'

C. suffixed with '%name'

D. prefixed with '%name'

Answer: Option A

Solution (By Examveda Team)

This SQL command is used to get information about the columns of a table.
Let's break down the command:
* SHOW COLUMNS FROM tbl_name: This part tells MySQL to display the column names of the table named 'tbl_name'.
* LIKE '%name': This part acts like a filter, specifying that we only want to see column names that end with 'name'. The '%' symbol is a wildcard in SQL, representing any number of characters.
Therefore, the correct answer is Option A: suffixed with 'name'.
This command will show only those column names that end with 'name'. For example, columns named 'first_name', 'last_name', or 'full_name' would be displayed.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous