SQL (Structured Query Language) is the language of databases. This "Back to Basics" SQL tutorial provides a great starting point and foundation for learning SQL or brushing up your skills.
This SQL Server tutorial will continue to be updated with content from SQL Server guru Denny Cherry, so please bookmark this page and return for regular updates.
 |
SQL Tutorial and Reference |
 |
To start learning SQL Server basics, simply click a link below to jump to a section.
→ The four basic SQL statements
→ SQL and SQL Server tutorials
→ Visit the SQL Server with Mr. Denny blog
 |
What is IT Knowledge Exchange?
|
 |
 |
 |
 |
 |
 |
IT Knowledge Exchange (ITKE) is a community of IT pros that share and pool their knowledge. You can ask your own IT question or share your expertise by answering a question. Do you have an IT problem that's driving you crazy? Come ask your peers and colleagues on IT Knowledge Exchange. You can even start your own blog and earn some cash for posting regularly.

→ Visit the ITKE Community Blog to learn how to get IT answers
|  |
|
 |
The SELECT statement
There are four basic commands in databases; SELECT, INSERT, UPDATE and DELETE. The most important of these is probably the SELECT statement, which is used to retrieve and display the data from the database.
The INSERT statement
While the SELECT statement is arguably the most important command, the INSERT comes in a close second. The INSERT statement is used to do exactly what it sounds like, this command inserts data into a database table.
The UPDATE statement
After data has been inserted into a table, you will at some point wish to update that data.This is done by using the UPDATE statement. The UPDATE statement can update a record or a set of records in a database table.
The DELETE statement
The DELETE statement is used when you wish to remove data from a table. Using the DELETE statement without a WHERE clause will remove all the data from your table. The WHERE clause works the same way as the WHERE clause for SELECT and UPDATE statements.
SQL Server Tables
Tables are the core of any database platform. Without SQL Server tables, there would be no way to store the data that we process. On the surface, tables may look similar to the rows and columns of a spreadsheet but they are very different.
CTE (Common Table Expressions)
One of the new features introduced in SQL Server 2005 was CTE (Common Table Expressions). In their simplest, most common form, you can think of them as a temporary, single use view.
SQL Server Views
Views are strange objects. They look like tables, can be queried like tables, but SQL Server Views don't store any actual data. Think of them as a virtual table which points to the source tables. Views can combine data from one or more tables via JOIN, just like a SELECT statement.
SQL Filters: JOIN vs. EXISTS vs. IN
Not all filters are the same. You can learn about filters in this comparison of JOIN vs. EXISTS vs. IN. Different filtering operations are used at different times to get the best performance out of your SQL Server.
SQL Server Endpoints
People, and applications, connect to SQL Server by way of endpoints. There are four different types of SQL Server endpoints; SERVICE_BROKER, DATABASE_MIRRORING, SOAP and TSQL.
Logins and Users
You'll sometimes see the terms Logins and Users used interchangeably. However, in Microsoft SQL Server, they are two very different things. Because everyone assumes that they are the same thing, it can get a little confusing.
The sp_change_users_login procedure
The specific purpose of the sp_change_users_login procedure is to identify and correct the users within a database that do not have corresponding logins.
SQL Functions
SQL functions create little blocks of code. Functions are fantastic for converting data from one format to another or for looking up other values based on a lookup. However, this comes at a price. That price is CPU power.
SQL Stored Procedures
Stored procedures are extremely useful objects. Not only do they store T/SQL scripts for later execution, but stored procedures also provide an extremely important security barrier between the user interface and the database.
SQL Server Memory Settings
Tweaking the memory settings just right in 32-bit versions of SQL Server can be tricky. Here's how to configure the memory setting in SQL Server.
The BACKUP DATABASE command
The BACKUP DATABASE command takes backups of the database, along with all tables, views, procedures and functions. This secures your information in case of a server failure or accidental data deletion.
The RESTORE DATABASE command
The RESTORE DATABASE command is what is used to recover a database which has been backed up using the BACKUP DATABASE command. The syntax of this command is very similar to the BACKUP DATABASE command in many respects..
 |
GOT IT QUESTIONS? YOUR PEERS HAVE ANSWERS
|
 |
 |
 |
 |
 |
 |
Your peers and colleagues have faced the same or similar problems. So ask your own question on the IT Knowledge Exchange community.
|  |
|
 |