Amaliy mashg’ulotlarida berilgan topshiriqlar


Download 395.12 Kb.
bet14/20
Sana15.11.2023
Hajmi395.12 Kb.
#1777301
1   ...   10   11   12   13   14   15   16   17   ...   20
Bog'liq
SQL command 29-11-2021

BACKUP DATABASE — zahira nusxalarni yaratish huquqi;
BACKUP TRANSACTION — tranzaktsiyalar zaxira nusxasini yaratish huquqi.


12 - LABORATORIYA ISHI
Mavzu: Bir nеchta jadvallar birlashtirish, JOINlar bilan ishlash


Ishdan maqsad: Berilgan predmet soha ma`lumotlar bazasidan foydalanib, bir nеchta jadvallar birlashtirish, JOINlar bilan ishlash.
Masalani qo`yilishi: Predmet soha ma`lumotlar bazasi shakllantirilgandan so`ng ob`yektlardagi ma`lumotlarni birlashtirish maqsadida INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN, FULL OUTER JOIN va ON standart so`zlaridan foydalanish. Barcha ob`yektlardagi ma`lumotlarni yuqoridagi standart so`zlar orqali birlashtiradigan so`rovlar tashkil etish.

Different types of JOINs in MySQL


MySQL JOIN type defines the way two tables are related in a query. MySQL supports the following types of JOIN clauses: INNER JOINOUTER JOIN, and CROSS JOIN. OUTER JOINs can further be divided into LEFT JOINs and RIGHT JOINs.
To better demonstrate how the JOINs work, we will create two tables.


CREATE TABLE members (
member_id INT AUTO_INCREMENT,
name VARCHAR(100),
PRIMARY KEY (member_id)
);


CREATE TABLE committees (
committee_id INT AUTO_INCREMENT,
name VARCHAR(100),
PRIMARY KEY (committee_id)
);


INSERT INTO members(name)
VALUES('John'),('Jane'),('Mary'),('David'),('Amelia');


INSERT INTO committees(name)
VALUES('John'),('Mary'),('Amelia'),('Joe');



Download 395.12 Kb.

Do'stlaringiz bilan baham:
1   ...   10   11   12   13   14   15   16   17   ...   20




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