Dab tsi yog hom ntaub ntawv rau feem pua hauv SQL?
Dab tsi yog hom ntaub ntawv rau feem pua hauv SQL?

Video: Dab tsi yog hom ntaub ntawv rau feem pua hauv SQL?

Video: Dab tsi yog hom ntaub ntawv rau feem pua hauv SQL?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim

Qhov feem pua ("P") tus qauv tshwj xeeb muab tus lej los ntawm 100 thiab hloov nws mus rau ib txoj hlua uas sawv cev rau feem pua. Yog 2 kaum tsib qhov chaw yog koj qib ntawm qhov tseeb, tom qab ntawd ib qho "smallint" yuav ua qhov no hauv qhov tsawg tshaj plaws (2-bytes). Koj khaws qhov feem pua tau muab 100.

Tsis tas li, hom ntaub ntawv twg yog feem pua ntawm kev nkag?

Txawm li cas los xij, hom ntaub ntawv tsis yog tus lej, ob npaug, lossis txawm kaum tsib – feem ntau nws yog ib leeg. Thaum koj teeb tsa qhov ntawd ntawm koj qhov feem pua ntawm cov teb, koj tuaj yeem sau cov ntaub ntawv hauv kaum tsib hom ntawv (piv txwv li 0.5, 0.25 thiab lwm yam) thiab nws yuav tshwm sim nyob rau hauv nws cov feem pua yog hom ntawv.

Qhov thib ob, Kuv yuav ua li cas feem pua hauv SQL? Hauv qhov no, peb tuaj yeem sau cov lus hauv qab no SQL ntawv nug rau xam , hauv SQL ntawv , cov feem pua ntawm cov qhab nia qhab nia: SELECT (sum(marks_subject)* 100)/1000 AS feem pua _marks NTAWM STUDENT_MARKS WHERE student_name = 'X'; Xaiv. (sum(marks_subject)*100)/1000 AS feem pua_marks.

Tsis tas li ntawd, hom ntaub ntawv hauv SQL yog dab tsi?

A hom ntaub ntawv yog tus cwj pwm uas qhia txog qhov hom ntawm cov ntaub ntawv uas cov khoom yuav tuav tau: integer cov ntaub ntawv , tus cwj pwm cov ntaub ntawv , nyiaj txiag cov ntaub ntawv , hnub thiab sijhawm cov ntaub ntawv , binary hlua, thiab lwm yam. SQL ntawv Server muab cov txheej txheem hom ntaub ntawv uas txhais tag nrho cov hom ntawm cov ntaub ntawv uas tuaj yeem siv nrog SQL ntawv Server.

Float data type yog dab tsi?

Cov FLOAT cov ntaub ntawv hom khw muag khoom ob-precision ntab -point tus lej nrog txog 17 tus lej tseem ceeb. FLOAT sib raug rau IEEE 4-byte ntab - taw tes, thiab mus rau ob hom ntaub ntawv nyob rau hauv C. Qhov ntau ntawm qhov tseem ceeb rau lub FLOAT cov ntaub ntawv hom yog tib yam li qhov ntau ntawm C ob npaug hom ntaub ntawv ntawm koj lub computer.

Pom zoo: