juniorMySQL

Viewing Table Structure

Updated May 4, 2026

Short answer

Use DESCRIBE or SHOW CREATE TABLE commands.

Deep explanation

DESCRIBE provides a quick overview of columns and types. SHOW CREATE TABLE gives the exact SQL needed to rebuild the table.

Real-world example

Checking a column's data type before performing an INSERT.

Common mistakes

  • Not checking if a column allows NULLs before a bulk import.

Follow-up questions

  • What does 'Extra' show in DESC?

More MySQL interview questions

View all →