Qhov ntau ntawm Tinyint hauv MySQL yog dab tsi?
Qhov ntau ntawm Tinyint hauv MySQL yog dab tsi?

Video: Qhov ntau ntawm Tinyint hauv MySQL yog dab tsi?

Video: Qhov ntau ntawm Tinyint hauv MySQL yog dab tsi?
Video: 016 Product Detail / ໜ້າສະແດງລາຍລະອຽດສີນຄ້າ 2024, Kaum ib hlis
Anonim
MySQL Cov ntaub ntawv
Ty p e S i z e D e s c r i p t i o n
TINYINT [Length] 1 byte ib Ntau yam ntawm -128 txog 127 lossis 0 txog 255 tsis tau kos npe.
SMALLINT [Length] 2 bytes Ntau yam ntawm -32, 768 txog 32, 767 lossis 0 txog 65535 tsis tau kos npe.
MEDIUM [Length] 3 bytes Ntau yam ntawm -8, 388, 608 txog 8, 388, 607 lossis 0 txog 16, 777, 215 tsis tau kos npe.

Ib yam li ntawd, Tinyint hauv MySQL yog dab tsi?

Hais txog INT, TINYINT Cov no yog cov ntaub ntawv sib txawv, INT yog 4-byte tus lej, TINYINT yog 1-byte tus lej. Lub syntax ntawm TINYINT hom ntaub ntawv yog TINYINT (M), qhov twg M qhia qhov siab tshaj plaws zaub dav (siv tsuas yog tias koj MySQL neeg txhawb nws).

Tsis tas li ntawd, qhov ntau ntawm Tinyint cov ntaub ntawv hom hauv SQL Server yog dab tsi? Tus lej hom ntaub ntawv Yog tias tsis tau kos npe, MySQL TINYINT datatype ua tau ntau los ntawm -127 mus rau 127; hos cov SQL Server TINYINT hom ib txwm thaj tsam 0 txog 255. Yog li, tshwj tsis yog nws yog ib qho tsis tau kos npe TINYINT , ib MySQL TINYINT datatype yuav tsum tau hloov mus rau lub SQL Server SMALLINT hom ntaub ntawv.

Tom qab ntawd, dab tsi yog qhov ntau ntawm INT hauv MySQL?

INT - Ib qho loj me me tus lej uas tuaj yeem kos npe lossis tsis kos npe. Yog kos npe, qhov tso cai ntau yog los ntawm -2147483648 txog 2147483647. Yog tias tsis kos npe, qhov tso cai ntau yog los ntawm 0 txog 4294967295. Koj tuaj yeem qhia qhov dav txog li 11 tus lej.

Tinyint yog dab tsi?

A TINYINT yog 8-ntsis integer tus nqi, BIT teb tuaj yeem khaws cia ntawm 1 ntsis, BIT(1), thiab 64 khoom, BIT(64). Rau tus nqi boolean, BIT(1) yog qhov zoo nkauj heev.

Pom zoo: