This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM Customers | |
ORDER BY Country |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Employees.LastName, COUNT(Orders.OrderID) AS NumberOfOrders | |
From (Orders | |
INNER JOIN Employees ON Orders.EmployeesID = Employees.EmployeeID) | |
GROUP BY LastName | |
HAVİNG COUNT(Orders.OrdersID) > 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(CustomerID), Country | |
FROM Customers | |
GROUP BY Country | |
HAVING COUNT(CustomerID) > 5 | |
ORDER BY COUNT(CustomerID) DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(CustomerID), Country | |
FROM Customers | |
GROUP BY Country | |
HAVING COUNT(CustomerID) > 5 ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Orders.OrderID, Customers.CustomerName, Shippers.ShipperName | |
FROM ((Orders | |
INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID) | |
INNER JOIN Shippers ON Orders.ShipperID = Shippers.ShipperID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate | |
FROM Orders | |
INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE Customers | |
SET ContactName = 'Sanchez'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE Customers | |
SET CustomerName = 'Bartu', | |
CustomerID = 91 | |
WHERE Country= 'Poland'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE Customers | |
SET ContactName = 'Karl John', City= 'İZMİR' | |
WHERE CustomerID = 89; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE table1 | |
SET column1 = (SELECT expression1 | |
FROM table2 | |
WHERE conditions) | |
[WHERE conditions]; |