h1

Cap.12 Join-uri in sql, interogari multi-tabela

March 20, 2010

1) Produs cartezian a 2 sau mai multe tabele (nu exista clauza where)

2) CROSS JOIN produs cartezian

3) Clauza where pt. join-ul a 2 tabele

Exemplul1:

Exemplul2:

Exemplul3:

Exemplul4:

continuare ex.4:

Exemplul5: Intersectie cu CORRESPONDING:

4) Join multiplu clauza where pt.a genera produsul cartezian

5) Alias-uri:

6) Natural Join

A NATURAL JOIN is a special type of equi-join with an implied WHERE clause that compares all columns in one table with corresponding columns that have the same name in another table for equality

7) Join conditional (clauza where), cross join:

8) Inner join exemplu:

9) Cuv.rezervat USING la INNER JOIN:

10) OUTER JOIN exemplu:

11) LEFT OUTER JOIN:

12) RIGHT OUTER JOIN si FULL OUTER JOIN:

Ex2:

13) JOIN la mai multe tabele intr-un singur query:

14) Non-equality inner join si outer join:

15) UNION JOIN:


16) Rolul unei clauze FROM intr-un join:

17) Operatorul * la clauza select

18) Single table join

19) Alias-uri:

20) Exemplu select cu procent

21) Exists – in loc de count(*) pt.a verifica daca o subcerere intoarce cel putin o inregistrare

22) Exemple joins cu clauza where si tratare valori NULL

22) Nested queries (subqueries) – lucreaza pe mai multe tabele dintr-o data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: