Laboratoriya mashg’ulotlarida berilgan topshiriqlar Создание таблиц


Download 416.23 Kb.
bet15/21
Sana19.08.2023
Hajmi416.23 Kb.
#1668308
1   ...   11   12   13   14   15   16   17   18   ...   21
Bog'liq
SQL command 29-11-2021 (5)

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 416.23 Kb.

Do'stlaringiz bilan baham:
1   ...   11   12   13   14   15   16   17   18   ...   21




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