Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、TINYINT が 3 文字を格納できる場合、なぜ 999 まで格納できないのでしょうか?
それはビットしか必要8としないため、値しかエンコードできません2^8 = 256。
8
2^8 = 256
次のような 3 つの文字'123'は、2 進数から 10 進数への変換の結果です。3そこに任意の文字を格納することはできません。
'123'
3
これは 8 ビットであり、実際には最大値 255 を格納できます。8 ビットには、ゼロを含む 256 の可能な状態があります。