How to returns the columns and column information pertaining to the designated table

mysql> show columns from tablename;

In MySQL, you can use the DESCRIBE statement or the SHOW COLUMNS statement to retrieve information about the columns of a table. Both commands provide details about the structure of a table.

  1. DESCRIBE statement:
    sql
    DESCRIBE your_table_name;

    Example:

    sql
    DESCRIBE employees;
  2. SHOW COLUMNS statement:
    sql
    SHOW COLUMNS FROM your_table_name;

    Example:

    sql
    SHOW COLUMNS FROM employees;

Both of these commands will return information about the columns, such as the column name, data type, whether it allows NULL values, key information, default values, and extra information (e.g., auto-increment). Choose either DESCRIBE or SHOW COLUMNS based on your preference; they essentially provide the same information.