Cartesian khoom hauv SQL Server yog dab tsi?
Cartesian khoom hauv SQL Server yog dab tsi?

Video: Cartesian khoom hauv SQL Server yog dab tsi?

Video: Cartesian khoom hauv SQL Server yog dab tsi?
Video: Attitude of sri chaitanya iit&neet ๐Ÿ› #iit #viral #shorts #motivation #neet #topper #jeeresults 2024, Kaum ib hlis
Anonim

Cov Cartesian khoom , kuj hu ua a ntoo khaub lig -join, rov qab tag nrho cov kab hauv tag nrho cov lus teev hauv cov lus nug. Txhua kab hauv thawj lub rooj yog ua ke nrog tag nrho cov kab hauv lub rooj thib ob. Qhov no tshwm sim thaum tsis muaj kev sib raug zoo ntawm ob lub rooj. Ob lub AUTHOR thiab STORE cov rooj muaj kaum kab.

Khaws qhov no hauv kev txiav txim siab, yog Cross koom tib yam li Cartesian khoom?

Ob tus koom muab ib yam tshwm sim. Hla - koom yog SQL99 koom thiab Cartesian khoom yog Oracle Proprietary koom . A ntoo khaub lig - koom uas tsis muaj 'qhov twg' clause muab rau Cartesian khoom . Cartesian khoom result-set muaj tus naj npawb ntawm kab hauv thawj lub rooj, muab faib los ntawm cov kab hauv ob lub rooj.

Tsis tas li ntawd, cross koom nrog SQL nrog piv txwv yog dab tsi? Cov CROSS JOIN koom txhua kab ntawm thawj lub rooj (T1) nrog txhua kab los ntawm lub rooj thib ob (T2). Hauv lwm lo lus, lub hla koom xa rov qab cov khoom Cartesian ntawm kab los ntawm ob lub rooj. Cov CROSS JOIN tau ib kab los ntawm thawj lub rooj (T1) thiab tom qab ntawd tsim kab tshiab rau txhua kab hauv lub rooj thib ob (T2).

Dhau li ntawm no, dab tsi ua rau Cartesian khoom?

Hauv ib CARTESIAN JOIN muaj kev koom ua ke rau txhua kab ntawm ib lub rooj rau txhua kab ntawm lwm lub rooj. Thaum tsis muaj qhov xwm txheej qhov twg CARTESIAN JOIN yuav coj zoo li ib CARTESIAN KHOOM . i.e., tus naj npawb ntawm kab hauv qhov tshwm sim-set yog qhov khoom ntawm tus naj npawb ntawm kab ntawm ob lub rooj.

Dab tsi yog qhov khoom koom nrog?

Definition ntawm Cov khoom koom nrog Cov khoom koom Sib piv txhua kab tsim nyog los ntawm ib qho kev sib raug zoo rau txhua kab kev tsim nyog los ntawm lwm qhov kev sib raug zoo thiab txuag cov kab uas phim qhov WERE predicate lim. Tsis muaj WHERE clause tau teev tseg hauv cov lus nug. Cov koom nyob rau ntawm qhov tsis sib xws. Muaj ORed koom tej yam kev mob.

Pom zoo: