Tus yuam sij tseem ceeb thib ob thiab tus yuam sij txawv teb chaws yog dab tsi?
Tus yuam sij tseem ceeb thib ob thiab tus yuam sij txawv teb chaws yog dab tsi?

Video: Tus yuam sij tseem ceeb thib ob thiab tus yuam sij txawv teb chaws yog dab tsi?

Video: Tus yuam sij tseem ceeb thib ob thiab tus yuam sij txawv teb chaws yog dab tsi?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Plaub Hlis Ntuj
Anonim

Foreign Key : yog Lub Ntsiab Tseem Ceeb ib lub rooj tshwm (hloov-referenced) hauv lwm lub rooj. Secondary (los yog Alternative) Ntsiab : Puas yog ib qho chaw hauv lub rooj uas tsis raug xaiv los ua ib qho ntawm ob hom saum toj no.

Tom qab ntawd, cov yuam sij tseem ceeb thiab cov yuam sij txawv teb chaws yog dab tsi?

Lub hauv paus tseem ceeb tshwj xeeb txheeb xyuas cov ntaub ntawv nyob rau hauv rooj . Tus yuam sij txawv teb chaws yog qhov chaw nyob hauv rooj uas yog qhov tseem ceeb hauv lwm qhov rooj . Lub Ntsiab Tseem Ceeb tsis tuaj yeem lees txais cov txiaj ntsig null. Tus yuam sij txawv teb chaws tuaj yeem lees txais ntau tus nqi null.

Ib yam li ntawd, tus yuam sij tseem ceeb thiab txawv teb chaws yog dab tsi nrog piv txwv? A LUB TSEV KAWM NTAWV yog a tus yuam sij siv los txuas ob lub rooj ua ke. A LUB TSEV KAWM NTAWV yog ib daim teb (lossis sau cov teb) hauv ib lub rooj uas hais txog qhov TSEEM CEEB nyob rau hauv lwm lub rooj. Cov kab "PersonID" nyob rau hauv lub rooj "Tib neeg" yog lub TSEEM CEEB nyob rau hauv lub rooj "Cov neeg".

Ua raws li qhov no, qhov tseem ceeb thiab qhov tseem ceeb thib ob yog dab tsi?

Secondary Key yog cov tus yuam sij uas tsis tau xaiv los ua tus thawj tus yuam sij . Yog li ntawd, ib tug neeg sib tw tus yuam sij tsis xaiv ua ib thawj tus yuam sij hu ua tus yuam sij thib ob . Cov neeg sib tw tus yuam sij yog tus cwj pwm los yog txheej txheem uas koj tuaj yeem txiav txim siab ua ib qho Thawj tus yuam sij . Nco tseg: Secondary Key tsis yog a Foreign Key.

Dab tsi yog qhov tseem ceeb thib ob hauv lub database?

DEFINITION: A tus yuam sij thib ob yog tsim rau ntawm daim teb uas koj xav tau indexed rau kev tshawb nrhiav sai. Ib lub rooj tuaj yeem muaj ntau tshaj ib qho tus yuam sij thib ob . Lub hom phiaj tseem ceeb ntawm a database yog khaws thiab tshawb nrhiav cov ntaub ntawv. Thaum twg databases ua loj, tejzaum nws muaj ntau pua txhiab cov ntaub ntawv, lawv tuaj yeem siv sijhawm los tshawb nrhiav

Pom zoo: