ASSIGNMENTsql
ASSIGNMENTsql
SELECT *
FROM Customer
WHERE Customername LIKE '%N'
AND PurchaseAmount > 500;
4. Using SET operators, retrieve the first result with unique
SalesmanId values from two tables, and the other result
containing SalesmanId with duplicates from two tables
SELECT SalesmanId
FROM Salesman
UNION
SELECT SalesmanId
FROM Orders;
SELECT SalesmanId
FROM Salesman
INTERSECT
SELECT SalesmanId
FROM Orders;
6.Using right join fetch all the results from Salesman and
Orders table.
SELECT
s.SalesmanId,
s.Name,
s.Commission,
s.City,
o.OrderId,
o.CustomerId,
o.OrderDate,
o.Amount money
FROM
Salesman s
RIGHT JOIN
Orders o ON s.SalesmanId = o.SalesmanId;