Cov txheej txheem:

SQL cov npe lub rooj puas muaj cov lej?
SQL cov npe lub rooj puas muaj cov lej?

Video: SQL cov npe lub rooj puas muaj cov lej?

Video: SQL cov npe lub rooj puas muaj cov lej?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Tej zaum
Anonim

Tag nrho SQL ntawv cov lus yuav tsum xaus nrog ";". Cov rooj thiab kem npe yuav tsum pib nrog ib tsab ntawv thiab ua tau ua raws li cov ntawv, tus lej , los yog underscores - tsis pub tshaj tag nrho ntawm 30 cim nyob rau hauv ntev. Cov ntaub ntawv hom qhia seb hom ntaub ntawv twg ua tau ua rau kab ntawv tshwj xeeb ntawd.

Kuj kom paub yog, lub rooj lub npe tuaj yeem pib nrog tus lej?

A npe yuav tsum pib nrog ib tsab ntawv los yog ib qho underscore; tus so ntawm txoj hlua ua tau muaj cov tsiaj ntawv, lej, thiab underscores. Koj ua tau tsim rooj los yog kab npe xws li "15909434_user" thiab user_15909434, tab sis tsim tsis tau rooj los yog kab npe pib nrog tus lej tsis siv ob nqe lus.

Ib sab saum toj no, SQL lub rooj npe puas muaj qhov chaw? Cov npe rooj tuaj yeem muaj cov cim siv tau (piv txwv li, qhov chaw ). Yog cov npe rooj muaj txhua tus cim tshwj tsis yog cov tsiaj ntawv, tus lej, thiab cov ntawv hauv qab, lub npe yuav tsum tau delimited los ntawm kaw nws hauv qab quotes (`).

Ib yam li ntawd, koj ua li cas lub npe lub rooj hauv database?

Tshwj xeeb, kuv yuav piav qhia txog kev sau npe rau cov khoom siv database, vim li cas lawv tseem ceeb heev, thiab koj yuav tsum ua dab tsi thiab tsis ua

  1. Ceeb toom!
  2. Zam cov lus qhia.
  3. Tus lej qis.
  4. Hom ntaub ntawv tsis yog npe.
  5. Underscores cais cov lus.
  6. Tag nrho cov lus, tsis yog abbreviations.
  7. Siv cov ntawv luv luv.
  8. Zam cov lus tshwj tseg.

Yuav tsum SQL lub npe lub npe yuav tsum tau sau npe?

1. SQL ntawv token yuav tsum muab categorized nyob rau hauv cov nqe lus ntawm lo lus tseem ceeb, identifier, cov ntaub ntawv hom, variables thiab tsis tu ncua. Hauv thawj nqe lus, tag nrho SQL ntawv reserved lus yog ntawv loj , tag nrho cov cim xws li rooj thiab kab ntawv yog tus lej qis, tab sis thawj tsab ntawv ua haujlwm npe yog peev (InitCap).

Pom zoo: