Northwind veritabanı için örnek komutlar

Yeni başlayan arkadaşlar için örnek sql komutlları. Anlaşılmayan yerleri sorabilirsiniz.

Select komutları :

use Northwind
select * from products
select ProductName,UnitPrice from products
select * from Shippers
select companyname,phone from Shippers
select * from Employees
select * from Employees as isciler
select LastName,FirstName from Employees isci
select lastname +”+firstname as [ad soyad] from Employees
select * from Products
select productname,unitprice,unitprice*1.18 as kdvli from Products

select * from Products
select productname,unitprice from products where unitprice>40
select firstname,city from Employees where city=’london’
select firstname,lastname,hiredate from Employees where HireDate>’1993′
select productname as urunadi ,UnitsInStock as stoksayisi from Products where UnitsInStock >= 17 and UnitsInStock <= 39
select ProductName,CategoryID from products where CategoryID =3 or CategoryID=5
select * from Orders where ShippedDate is null
select * from Orders where ShippedDate is not null
select CategoryID,UnitPrice,UnitsInStock from Products where CategoryID=5 and UnitPrice >20 and UnitPrice<300 and UnitsInStock is not null
select CustomerID,EmployeeID,ShipVia,ShipRegion from orders where (CustomerID = ‘DUMON’ or CustomerID =’ALFKI’) and EmployeeID=1 and ShipVia=3 and ShipRegion is null
select ProductName,ProductID,UnitsInStock from Products where UnitsInStock between 10 and 15

select firstname+’ ‘+lastname as adsoyad from Employees order by adsoyad
select ProductName,UnitsInStock from Products where UnitsInStock>50 order by UnitsInStock
select top 3 ProductName,UnitPrice from Products order by UnitPrice desc

 

Northwind Database Sample

The Northwind Traders sample database contains the sales data for a fictitious company called Northwind Traders, which imports and exports specialty foods from around the world. The database contains information about customers, suppliers, products, orders and employees (as well as a few other bits of miscellaneous information).

Örnek SQL veritabanı (Northwind)

 

SQL’de yeniyseniz ve çalışmak için örnek veri tabanına ihtiyacınız varsa vereceğim linki indirebilirsiniz. Arama motorlarında bu veri tabanı ile yapılmış bir çok ders ve örnekleri rahatlıkla bulabilirsiniz. SQL’in tüm sürümlerinde sorunsuzca çalıştırabilirsiniz.

indirme linki :  http://www.microsoft.com/en-us/download/details.aspx?id=23654

Northwind and pubs Sample Databases for SQL Server 2000,2005,2010,2012

Microsoft® SQL Server® 2012 Express – Download

 

Microsoft® SQL Server® 2012 Express – Download

ENU\x64\SQLEXPR_x64_ENU.exe 132.3 MB
ENU\x64\SQLEXPRADV_x64_ENU.exe 1.3 GB
ENU\x64\SQLEXPRWT_x64_ENU.exe 669.9 MB
ENU\x64\SqlLocalDB.MSI 33.0 MB
ENU\x64\SQLManagementStudio_x64_ENU.exe 600.2 MB
ENU\x86\SQLEXPR_x86_ENU.exe 116.7 MB
ENU\x86\SQLEXPR32_x86_ENU.exe 101.5 MB
ENU\x86\SQLEXPRADV_x86_ENU.exe 1.3 GB
ENU\x86\SQLEXPRWT_x86_ENU.exe 706.1 MB
ENU\x86\SqlLocaLDB.MSI 27.8 MB
ENU\x86\SQLManagementStudio_x86_ENU.exe 614.9 MB

indirme linki :  http://www.microsoft.com/en-us/download/details.aspx?id=29062