29.06.2013 Views

CERERI SELECT PE MAI MULTE TABELE - Baze de date

CERERI SELECT PE MAI MULTE TABELE - Baze de date

CERERI SELECT PE MAI MULTE TABELE - Baze de date

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

JOIN – cont.<br />

În cazul în care condiţia <strong>de</strong> join nu este completă<br />

rezultatul va conţine un produs cartezian între<br />

joinurile existente şi restul tabelelor.<br />

Exemplu: în cererea următoare lipseşte condiţia <strong>de</strong><br />

join care leagă tabela BURSA <strong>de</strong> celelalte tabele.<br />

<strong>SELECT</strong> S.NUME, S.CODS, "SP STUD".NUME,<br />

TIP<br />

FROM STUD S, S<strong>PE</strong>C "SP STUD", BURSA<br />

WHERE S.CODS = "SP STUD".CODS;<br />

În acest caz rezultatul obţinut este produsul<br />

cartezian între BURSA şi joinul lui STUD cu S<strong>PE</strong>C şi<br />

va avea 60 <strong>de</strong> linii (5 linii din BURSA * 12 linii ale<br />

joinului STUD cu S<strong>PE</strong>C).<br />

F. Radulescu. Curs: <strong>Baze</strong> <strong>de</strong> <strong>date</strong> -<br />

Limbajul SQL<br />

17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!