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 JOIN, OUTER 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');
Do'stlaringiz bilan baham: |