The INNER JOIN keyword selects records that have matching values in both tables.
INNER JOIN Syntax
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
2.Left join:
4-rasm. Left join
SQL LEFT JOIN keyword
The keyword LEFT JOINreturns all records from the left table (table1) and the corresponding records from the right table (table2). The result is 0 records on the right side if there are no matches.
SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name; 3. Right join: SQL RIGHT JOIN keyword
The keyword RIGHT JOINreturns all records from the right table (table2) and the corresponding records from the left table (table1). The result is 0 records on the left side if there are no matches.
SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name; 5-rasm. Right join SQL FULL OUTER JOIN Keyword
The keyword FULL OUTER JOINreturns all records if there is a match in the left (table 1) or right (table 2) records of the table.
Tip: FULL OUTER JOIN they are the FULL JOINsame.
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition; 6-rasm. Full outer join
2-topshiriq. SQL tilida INDEX yaratish. Tasavvur, VIEW yaratish va undan foydalanish. QLda funksiyalar yaratish. SQLda triggerlar yaratish. Mavzusiga doir Youtube tizimida Video darsliklarni ko‘rish va kengaytirilgan ko‘rinishda video mazmunini bayon qilish.
2.Triggerlar bu jadval bilan bog’langan va jadval uchun malum bir hodisa bo’lganda faollashadigan nomili malumotlar bazasi obekti.
Trigger doimoiy jadvalga murojat qilishi kerak bo’lgan jadval nomi bilan bog’lanadi.
Trigger time bu trigger harakat vaqti triggerni o’zgartirilishi kerak bo’lgan qatordan oldin yoki keyin bo’lishi mumkin.
Trigger event triggerni faollashtiradigan operatsiya turini bildiradi
INSERT Trigger har safar jadvalga yangi qator kiritilganda faollashadi
UPDATE Trigger har safar satr o’zgartirilganda faollashadi
DELETE Trigger jadvaldan satr o’chirilganda faollashadi, jadvaldagi DROP TABLe va TRUNCATE TABLE operatorlari bu triggerni faolashtirmaydi chunki ular DELETE dan foydalanmaydi
CREATE VIEW iborasi yangi ko'rinish hosil qiladi yoki OR REPLACE bandi berilgan bo'lsa, mavjud ko'rinishni almashtiradi. Agar ko'rinish mavjud bo'lmasa, CREATE OR PLACE VIEW KO'RISHNI YARASH bilan bir xil bo'ladi. Agar ko'rinish mavjud bo'lsa, uni o'rnini CREATE OR REPLACE KO'RINGNI o'zgartiradi.
VIEW ta'rifi quyidagi cheklovlarga bo'ysunadi:
SELECT iborasi FROM bandida pastki so'rovni o'z ichiga olmaydi.
SELECT iborasi tizim o'zgaruvchilari yoki foydalanuvchi tomonidan belgilangan o'zgaruvchilarga murojaat qila olmaydi.
Saqlangan dastur ichida SELECT iborasi dastur parametrlariga yoki mahalliy o'zgaruvchilarga murojaat qila olmaydi.
SELECT iborasi tayyorlangan bayonot parametrlariga murojaat qila olmaydi.
Do'stlaringiz bilan baham: |