Dab tsi yog qhov txawv ntawm Int thiab Bigint hauv SQL?
Dab tsi yog qhov txawv ntawm Int thiab Bigint hauv SQL?

Video: Dab tsi yog qhov txawv ntawm Int thiab Bigint hauv SQL?

Video: Dab tsi yog qhov txawv ntawm Int thiab Bigint hauv SQL?
Video: Qhia txhais 50 zaj npau suav tias yog dab tsi part 3 15 Sep 2019 2024, Kaum ib hlis
Anonim

Qhov tsis tau kos npe yog 0 txog 18446744073709551615. Ok, zoo INT tuaj yeem khaws tus nqi rau 2.1 Billion, thiab ib qho a BIGINT tuaj yeem khaws tus nqi rau qee tus lej loj dua rau 20 tus lej. Cov naj npawb uas peb pom tias INT yog 4 byte tus lej , thiab a BIGINT ib 8byte tus lej.

Raws li, Bigint hauv SQL yog dab tsi?

Cov BigInt ntaus ntawv hauv SQL ntawv Server yog tus sawv cev 64-ntsis ntawm tus lej. Nws yuav siv li 8 bytes cia. Nws tuaj yeem nyob ntawm -2^63 (-9, 223, 372, 036, 854, 775, 808) txog 2^63 (9, 223, 372, 036, 854, 775, 807). SQL ntawv Server nyiam indexes uas nqaim, thiab kwv yees.

Qhov txawv ntawm Int thiab Smallint yog dab tsi? INTEGER qhov tseem ceeb muaj 32 cov khoom thiab tuaj yeem sawv cev tag nrho cov lej los ntawm -2 31-1 mus rau 2 31–1. SMALLINT cov nqi tsuas muaj 16 ntsis. Lawv tuaj yeem sawv cev tag nrho ntawm -32, 767 txog 32, 767.

Tsis tas li ntawd, Bigint yog dab tsi?

Ib tug loj integer yog ib tug binary integer uas muaj ib tug precision ntawm 63 khoom. Cov BIGINT hom ntaub ntawv tuaj yeem sawv cev rau 63-ntsis cov lej thiab sib xws nrog txhua hom ntaub ntawv tus lej. Cov BIGINT muaj nuj nqi rov qab tus lej loj sawv cev ntawm tus lej lossis ib txoj hlua sawv cev ntawm tus lej.

Ib tug Bigint loj npaum li cas?

8 bytes

Pom zoo: