What is the difference between CHAR and VARCHAR data types?

SQL Fundamentals Medium

SQL Fundamentals — Medium

What is the difference between CHAR and VARCHAR data types?

Key points

  • CHAR pads shorter strings with spaces
  • VARCHAR dynamically adjusts space usage
  • CHAR is fixed-length, VARCHAR is variable-length

Ready to go further?

Related questions