Dab tsi yog daim ntawv teev lus poob?
Dab tsi yog daim ntawv teev lus poob?

Video: Dab tsi yog daim ntawv teev lus poob?

Video: Dab tsi yog daim ntawv teev lus poob?
Video: Lig Pob tsuas xyooj nkauj tawm tshiab 2022-2023 2024, Kaum ib hlis
Anonim

Lub SQL DROP TABLE nqe lus yog siv los tshem tawm a rooj txhais thiab tag nrho cov ntaub ntawv, indexes, triggers, txwv thiab tso cai specifications rau qhov ntawd rooj.

Tsuas yog li ntawd, qhov nqe lus poob hauv SQL ua li cas?

SQL DROP TABLE nqe lus yog siv los tshem tawm rooj hauv database. Thaum koj siv lub SQL DROP TABLE nqe lus tshem a rooj , lub cav database deletes tag nrho cov khoom txuam nrog rau qhov ntawd rooj suav nrog cov ntaub ntawv, rooj qauv, indexes, txwv, triggers thiab tej zaum muaj cai.

Tsis tas li ntawd, lub hom phiaj ntawm IF poob nqe lus yog dab tsi? Cov DROP TABSIS nqe lus tshem tawm cov lus teev tseg, thiab cov ntaub ntawv cuam tshuam nrog nws, los ntawm cov ntaub ntawv. Cov IF EXISTS clause tso cai rau nqe lus kom ua tiav txawm yog tsis muaj cov lus teev tseg. Yog lub rooj tsis muaj nyob thiab koj tsis suav nrog IF EXISTS clause, cov nqe lus yuav rov qab ua yuam kev.

Ib yam li ntawd, koj tuaj yeem nug, Kuv yuav tso lub rooj los ntawm cov ntaub ntawv li cas?

Rau poob ib yam uas twb muaj lawm rooj , koj qhia lub npe ntawm tus rooj tom qab lub DROP TABLE lus. Yog tias rooj uas yog poob tsis muaj, cov database system teeb meem yuam kev. Txhawm rau tiv thaiv qhov yuam kev ntawm kev tshem tawm qhov tsis muaj rooj , peb siv cov lus xaiv xaiv yog tias EXISTS.

Qhov txawv ntawm qhov poob thiab rho tawm yog dab tsi?

DELETE hais kom ua yog Data Manipulation Language command whereas, DROP yog Data Definition Language Command. Lub ntsiab lus uas txawv DELETE thiab DROP lus txib yog li ntawd DELETE yog siv los tshem tuples ntawm lub rooj thiab DROP yog siv los tshem tawm tag nrho schema, rooj, sau lossis txwv los ntawm cov ntaub ntawv.

Pom zoo: