h1

Cap9. Interogari tabele multiple si creare view-uri

March 18, 2010

Ex1:

Ex2:

Ex3 : Folosirea unui view pt.a afisa rezultatele unei expresii : (in select se pot face si calcule):

Ex4: UPDATE la mai multe tabele intr-un view

Ex5: Clauza CHECK option la VIEW pt.aplicarea constrangerilor impuse pt.UPDATE si INSERT:

Ex6: Afisarea intr-un view a anumitor linii si coloane dintr-o tabela:

Ex7: Clauzele GROUP BY (pt.fiecare col.unica specificata in group by) si clauza ORDER BY folosite intr-un view:

Ex8: Join la 2 sau mai multe tabele si afisare informatiilor intr-un view (ce cuprinde informatii din mai multe tabele):

Ex9: Operatorul UNION si UNION ALL (reuniunea datelor din 2 sau mai multe tabele):

a) Exemple cu operatorul UNION (de reuniune):

b) Operatorul UNION ALL (reuneste toate inregistrarile din mai multe tabele chiar si pe cele duplicat!!!):

c) UNION CORESPONDING

d) UNION ce combina rezultatele a 2 cereri:

e) UNION ce combina rez.din 3 tabele si clauza ORDER BY in UNION:

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: