This SQL Server tutorial is for anyone who wishes to learn how to use SQL Server. It assumes a basic understanding of databases and how they work.
If you don't currently have an understanding of how databases work, start with the basic database tutorial first. That tutorial covers the basic concepts of databases, so the examples in this tutorial will make more sense once you return here.
To get the most out of this tutorial, you should have a copy of SQL Server installed on your computer, so that you can go through the examples yourself. If you don't have a copy, that's OK - you should still be able to gain an understanding of what SQL Server is and what's involved in using it.
You will find 2 tutorials here; a tutorial for SQL Server 2008, and a tutorial for SQL Server 2000.
SQL Server 2008
This tutorial covers the 2008 edition of SQL Server (SQL Server 2008). Specifically, it uses (the free) SQL Server 2008 Express with Advanced Tools.
This tutorial consists of the following lessons:
About SQL Server
SQL Server Editions
SQL Server - Management Studio
SQL Server - Create a Database
SQL Server - Create a Table
SQL Server - Adding Data
SQL Server - Query Designer
SQL Server Views
SQL Server Stored Procedures
About SQL Server
Microsoft SQL Server is a Relational Database Management System (RDBMS) designed to run on platforms ranging from laptops to large multiprocessor servers. SQL Server is commonly used as the backend system for websites and corporate CRMs and can support thousands of concurrent users.
SQL Server comes with a number of tools to help you with your database administration and programming tasks.
SQL Server is much more robust and scalable than a desktop database management system such as Microsoft Access. Anyone who has ever tried using Access as a backend to a website will probably be familiar with the errors that were generated when too many users tried to access the database!
Although SQL Server can also be run as a desktop database system, it is most commonly used as a server database system.
Server Database Systems
Server based database systems are designed to run on a central server, so that multiple users can access the same data simultaneously. The users normally access the database through an application.
For example, a website could store all its content in a database. Whenever a visitor views an article, they are retrieving data from the database. As you know, websites aren't normally limited to just one user. So, at any given moment, a website could be serving up hundreds, or even thousands of articles to its website visitors. At the same time, other users could be updating their personal profile in the members' area, or subscribing to a newsletter, or anything else that website users do.
Generally, it's the application that provides the functionality to these visitors. It is the database that stores the data and makes it available. Having said that, SQL Server does include some useful features that can assist the application in providing its functionality.
SQL Server Editions
SQL Server comes in many editions. Some are paid versions others are free. The examples in this tutorial were done using the free Express version of SQL Server.
We would discuss the various editions of SQL Server 2008.
If you are serious about installing (or upgrading) SQL Server, this page provides a quick overview of your options.
SQL Server 2008 comes in many different editions. The edition you choose will depend on your requirements. If you are looking for a free database management system, you will need to choose one of the Express editions or the Compactedition. You could also try the Evaluation edition, which allows you to trial SQL Server 2008 for 180 days.
Here are the different editions available for SQL Server 2008.
The examples in this tutorial were made using the (free) Express edition of SQL Server 2008. To be more precise, it is SQL Server 2008 Express with Advanced Services.
SQL Server 2008 Express with Advanced Services includes the following features:
The Express edition also comes as SQL Server 2008 Express with Tools, which only includes the SQL Server database engine and the SQL Server Management Studio Basic, and SQL Server 2008 Express (Runtime Only) which doesn't include the SQL Server Management Studio.
While the free version of SQL Server does have its limitations, it is a good start for those starting out with SQL Server.
SQL Server Edition in this Tutorial
Data management and business intelligence platform providing enterprise class scalability, high availability, and security for running business-critical applications
Data management and business intelligence platform providing ease of use and manageability for running departmental applications
Data management and reporting platform providing secure, remote synchronization, and management capabilities for running branch applications
May be installed and used by one user to design, develop, test, and demonstrate your programs on as many systems as needed
A low-TCO, scalable, and manageable database option for web hosters and end customers looking to deploy publicly facing web applications and services
A free edition of SQL Server ideal for learning and building desktop and small server applications and for redistribution by ISVs
A free, SQL Server embedded database ideal for building stand-alone and occasionally connected applications for mobile devices, desktops, and web clients
This edition may be installed for demonstration and evaluation purposes until an expiration period of 180 days.
SQL Server database engine - create, store, update and retrieve your data
SQL Server Management Studio Basic - visual database management tool for creating, editing and managing databases
Full-text Search - powerful, high-speed engine for searching text-intensive data
Reporting Services - integrated report creation and design environment to create reports