Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 721907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:55:39+00:00 2026-05-14T05:55:39+00:00

Just to clarify, by specifying something like VARCHAR(45) means it can take up to

  • 0

Just to clarify, by specifying something like VARCHAR(45) means it can take up to max 45 characters? I remember I heard from someone a few years ago that the number in the parenthesis doesn’t refer to the number of characters, then the person tried to explain to me something quite complicated which I don’t understand and forgot already.

And what is the difference between CHAR and VARCHAR? I did search around a bit and see that CHAR gives you the max of the size of the column and it is better to use it if your data has a fixed size and use VARCHAR if your data size varies.

But if it gives you the max of the size of the column of all the data of this column, isn’t it better to use it when your data size varies? Especially if you don’t know how big your data size is going to be. VARCHAR needs to specify the size (CHAR don’t really need right?), isn’t it more troublesome?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:55:40+00:00Added an answer on May 14, 2026 at 5:55 am

    You also have to specify the size with CHAR. With CHAR, column values are padded with spaces to fill the size you specified, whereas with VARCHAR, only the actual value you specified is stored.

    For example:

    CREATE TABLE test (
        char_value CHAR(10),
        varchar_value VARCHAR(10)
    );
    
    INSERT INTO test VALUES ('a', 'b');
    
    SELECT * FROM test;
    

    The above will select “a          ” for char_value and “b” for varchar_value

    If all your values are about the same size, the CHAR is possibly a better choice because it will often require less storage space than VARCHAR. This is because VARCHAR stores both the length of the value and the value itself, whereas CHAR can just store the (fixed-size) value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone just clarify how UIView works in this context? Is it just part
Just to clarify, I mean something like: class foon { private $barn = null;
Can anyone just clarify this for me, I was under the impression that to
I need just to clarify that given collection contains an element. I can do
I'm having a problem and believe something simple, just can't get a grip on
How can I remove the first \n character from an NSString? Edit: Just to
This is not a request for a solution, but just to clarify something. When
I really hope someone has some insight into this. Just to clarify what I'm
Just to clarify, ths isn't really a question, more some help for people like
Just to clarify, when I say multiple assigment, parallel assignment, destructuring bind I mean

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.