Laboratoriya ishi-13 Mavzu: Having standart so‘zi orqali so‘rovlar yaratish Tekshirdi: Nurjanov Furqatbek Bajardi


SELECT     column_names [,... n]


Download 433.24 Kb.
bet4/4
Sana08.01.2022
Hajmi433.24 Kb.
#244653
1   2   3   4
Bog'liq
13-laboratoriyaAbror

SELECT

    column_names [,... n]



FROM

    Table_1 CROSS JOIN Table_2





  1. SQL FULL OUTER JOIN operatori 1 jadvaldagi xar bir element uchun 2 jadvaldagi elementlarni bog`lab chiqadi.

SQL FULL OUTER JOIN operatorining sintaksisi quyidagi ko`rinishda bo`ladi:




SELECT

    column_names [,... n]



FROM

    Table_1 FULL JOIN Table_2



ON condition



12.4 – rasm. Full outer join operatorining Venn diagrammasi orqali ko’rinishi.
Ishni bajarish tartibi

Faculty, university, xodim nomli jadvalla ustida vazifa bajariladi:



  1. SQL INNER JOIN operatori

So`rov:

SELECT f.id, f.name faculty, u.name university

FROM faculty f INNER JOIN university u

ON f.id_test1_foreign=u.id;

Natija:


2. LEFT JOIN operatori

So`rov: SELECT f.id, f.name faculty, u.name university

FROM faculty f LEFT JOIN university u

ON f.id_test1_foreign=u.id;

Natija:




  1. RIGHT JOIN operatori

So`rov: SELECT f.id, f.name faculty, u.name university

FROM faculty f RIGHT JOIN university u

ON f.id_test1_foreign=u.id;

Natija:


3. CROSS JOIN operatori

So`rov: SELECT *

FROM faculty CROSS JOIN xodim

ON faculty.id=xodim.faculty_id;

Natija:

4. LEFT OUTER JOIN operatori:



So`rov: SELECT *

FROM faculty LEFT OUTER JOIN xodim

ON faculty.id=xodim.faculty_id;

Natija:

5. RIGHT OUTER JOIN operatori:



So`rov: SELECT *

FROM faculty RIGHT OUTER JOIN xodim

ON faculty.id=xodim.faculty_id;

Natija:



Vazifalar

  1. Yuqorida ko`rsatilganlardan foydalanib tanlangan variyantga muvofiq mavzu uchun MySQL da INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN, FULL OUTER JOIN va ON standat so`zilari bilan ishlang.

  2. Bajarilgan ishlar haqida hisobot tayyorlang (1-2-ilovalarga qarang).


Nazorat savollari

  1. SQL tilidagi qanday JOIN larni bilasiz?

  2. INNER JOIN qanday vazifani bajaradi?

  3. LEFT JOIN qanday vazifani bajaradi?

  4. RIGHT JOIN qanday vazifani bajaradi?

  5. CROSS JOIN qanday vazifani bajaradi?

FULL OUTER JOIN qanday vazifani bajaradi?
Download 433.24 Kb.

Do'stlaringiz bilan baham:
1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling