SQL



SQL Tutorial

SQL - pronounced sequel - stands for Structured Query Language. It is the language used to access data stored in a SQL database. With SQL, you can query your database in a variety of ways, using English-like statements.
With SQL, data is stored in tables. A table is a set of columns and rows.  Each column is referred to as a field. Each value in a field represents a single type of data. For example, a table might have three fields: name, city, and state. The table will consist of three columns: one for name, one for city, and one for state.  For every row in the table, the name field contains the name, the city field contains the city, and the state field contains the state. A database is a collection of related data. It can also be viewed as a collection of related tables. This tutorial is on storing data in and retieving data from a SQL database. 

SQL Basics

Lesson 1: Introduction
Lesson 2: Creating Tables in SQL
Lesson 3: Importing Data in SQL
Lesson 4: Retrieving All Data in SQL
Lesson 5: Retrieving a Single Column in SQL
Lesson 6: Retrieving Multiple Columns in SQL
Lesson 7: Formatting Numbers in SQL
Lesson 8: Ordering Rows in SQL
Lesson 9: Displaying Rows in Descending Order in SQL
Lesson 10: Ordering Multiple Columns in SQL
Lesson 11: Retrieving Specific Rows in SQL (Logical Operators)
Lesson 12: Multiple Conditions in SQL
Lesson 13: Joining Tables in SQL
Lesson 14: Updating Tables in SQL
Lesson 15: Deleting Rows in SQL
Lesson 16: Inserting Rows in SQL


SQL Intermediate



This Intermediate/Advanced SQL Tutorial will cover the SELECT statement in great detail. The SELECT statement is the core of SQL, and it is likely that the vast majority of your SQL commands will be SELECT statements. Due to the enormous amount of options available for the SELECT statement, this entire tutorial has been dedicated to it.

When constructing SQL Queries (with the SELECT statement), it is very useful to know all of the possible options and the best or more efficient way to do things. This Tutorial will help provide you with those skills.

1. SELECT Statement in SQL

    1.a) FROM & WHERE clause in SQL
    1.b) LIKE clause in SQL
    1.c) ALL & DISTINCT Keywords in SQL
2. Aggregate Functions in SQL (Min, Max, Sum, Avg, Count)
3. GROUP BY clause in SQL
4. HAVING clause in SQL
5. ORDER BY clause in SQL
6. Combining Conditions & Boolean Operators in SQL
7. IN & NOT IN keywords in SQL
8. BETWEEN & NOT BETWEEN Keywords in SQL
9. Mathematical Functions in SQL
10. Table Joins in SQL (a must)






SQL Server 2008 Tutorial



This SQL Server tutorial is for anyone who wants to learn how to use SQL Server 2008. 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. The examples in this tutorial are all done using the free version of SQL Server - SQL Server 2008 Express. You can download SQL Server 2008 Express from the Microsoft website.

If you don't currently have SQL Server yet, that's OK. The tutorial is straight forward and contains plenty of screenshots.

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.(download)


Also you can download SQL Server 2008 Express from Microsoft's website.



Table of Contents

Lesson01: SQL Server Management Studio (SSMS)
Lesson02: SQL Server - Create a Database
Lesson03: SQL Server - Create a Table
Lesson04: SQL Server - Adding Data
Lesson05: SQL Server - SQL Scripts
Lesson06: SQL Server - Query Designer
Lesson07: SQL Server - Views
Lesson08: SQL Server - Stored Procedures
Lesson09: SQL Server - User Logins
Lesson10: SQL Server - Server Roles
Lesson11: SQL Server - Database Schemas
Lesson12: SQL Server - Linked Servers