select City, LastName+ ' ' + FirstName from Employees
where City like 'London' or LastName like 'King '
select City, LastName+ ' ' + FirstName from Employees
where City like 'London' and LastName like 'King '
select Distinct City from Employees
select Top 10 * from Employees order by City
select LastName as name, Region,
CASE when Region is null then 'yoq'
else Region end as 'hudud'
from Employees
select o.OrderID as id,
o.OrderDate as 'buyurtma sanasi',
c.CompanyName as 'mijoz'
from Orders as o
join Customers as c
on o.CustomerID=c.CustomerID
order by id desc
select ord.OrderID as 'OrdID',
ord.OrderDate as 'Buyurtma vaqti',
ord.CustomerID as 'mijozID', cus.CustomerID as 'Mijoz ID'
from Orders as ord
left join Customers as cus
on ord.CustomerID=cus.CustomerID
select ord.OrderID as 'OrdID',
ord.OrderDate as 'Buyurtma vaqti',
ord.CustomerID as 'mijozID', cus.CustomerID as 'Mijoz ID'
from Orders as ord
right join Customers as cus
on ord.CustomerID=cus.CustomerID
select ord.OrderID as 'OrdID',
ord.OrderDate as 'Buyurtma vaqti',
ord.CustomerID as 'mijozID', cus.CustomerID as 'Mijoz ID'
from Orders as ord
left join Customers as cus
on ord.CustomerID=cus.CustomerID
union
select ord.OrderID as 'OrdID',
ord.OrderDate as 'Buyurtma vaqti',
ord.CustomerID as 'mijozID', cus.CustomerID as 'Mijoz ID'
from Orders as ord
right join Customers as cus
on ord.CustomerID=cus.CustomerID
select ord.OrderID as 'OrdID',
ord.OrderDate as 'Buyurtma vaqti',
ord.CustomerID as 'mijozID', cus.CustomerID as 'Mijoz ID'
from Orders as ord
left join Customers as cus
on ord.CustomerID=cus.CustomerID
union all
select ord.OrderID as 'OrdID',
ord.OrderDate as 'Buyurtma vaqti',
ord.CustomerID as 'mijozID', cus.CustomerID as 'Mijoz ID'
from Orders as ord
right join Customers as cus
on ord.CustomerID=cus.CustomerID