select * from Employees (Employees jadvalini chiqarish)
select EmployeeID as emp from Employees (Employees jadvalidan EmployeeId ustunini emp ustuni korinishida chqarish)
select EmployeeID as emp, LastName as Name from Employees where Country = 'UK'
select count(*) Name from Employees
select count(LastName) from Employees
select LastName, City from Employees
where City = 'London'
order by LastName(DESC, )
select count (EmployeeID) from Employees
group by City
select LastName+ ' ' + FirstName from Employees
select LastName+ ' ' + FirstName from Employees
where FirstName like 'A%'
select LastName+ ' ' + FirstName from Employees
where FirstName like '_A%'
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