3-amaliy ish union start buyruqlaridan foydalainsh


Download 10.72 Kb.
Sana18.06.2023
Hajmi10.72 Kb.
#1585982


3-AMALIY ISH



  1. UNION start buyruqlaridan foydalainsh.


1-rasm Shu ikki jadvalni City maydonlarini birlashtiramiz


SELECT City FROM Customers


UNION
SELECT City FROM Suppliers
ORDER BY City;



2-rasm natija



  1. «Join» lar bilan ishlash (INNER JOIN, RIGHT JOIN, LEFT JOIN).


3-rasm IKKI jadvalni bir xil maydonlarini ulaymiz

SELECT Orders.OrderID, Customers.CustomerName


FROM Orders
INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;

4-rasm Natija

2.1 LEFT JOIN bilan ishlash



5-rasm LEFT JOIN oraqali orderId va CustumersName
Maydonlarini birlshtiryabmiz

SELECT Customers.CustomerName, Orders.OrderID


FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;



6-rasm Natija
2.3 RIGT JOIN bilan ishlash

7-rasm RIGHT JOIN orqali Last name va First name maydonlarini birashtiramiz

SELECT Orders.OrderID, Employees.LastName, Employees.FirstName


FROM Orders
RIGHT JOIN Employees
ON Orders.EmployeeID = Employees.EmployeeID
ORDER BY Orders.OrderID;



8-rasm Natija
Download 10.72 Kb.

Do'stlaringiz bilan baham:




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