22 Mart 2012 Perşembe

Açık Akademi 20 Mart 2012 Sanal Sınıfı - SQL Eğitimi Kod Dosyası

20 Mart 2012 Salı akşamı gerçekleşen sanal sınıf oturumunda yazmış olduğumuz sorguları aşağıda bulabilirsiniz.
select * from dbo.Categories

select CategoryName, [Description] from dbo.Categories

select [Description],CategoryName from dbo.Categories

select CategoryID, [Description],CategoryName, CategoryID from dbo.Categories

select CategoryID as [Kategori No], [Description] Aciklama ,CategoryName, CategoryID from dbo.Categories

select * from dbo.[Order Details]

select * from Products

select ProductID as [Urun No],
       ProductName Ad,
       UnitPrice Fiyat
 from dbo.Products
order by 2

select ProductID as [Urun No],
       ProductName Ad,
       UnitPrice Fiyat
 from dbo.Products
order by Fiyat

select ProductID as [Urun No],
       ProductName Ad,
       UnitPrice Fiyat
 from dbo.Products
where UnitPrice != 38
order by Fiyat desc, Ad

select * from dbo.Products where UnitPrice > 60

select ProductName as Ad,
       UnitsInStock StokMiktari
  from dbo.Products
 where CategoryID = 8 and UnitPrice <= 10
order by Ad

select COUNT(*) as KayitSayisi from dbo.Products

select * from dbo.Customers

select COUNT(Region) from dbo.Customers

select * from Customers where City = 'london'

select CustomerID from Customers where PostalCode = 'WX1 6LT'
select * from Orders where CustomerID = 'CONSH'

select * from Orders where CustomerID = (select CustomerID from Customers where PostalCode = 'WA1 1DP')

Hiç yorum yok: