Quantcast
Browsing all 162 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

How to use the EXCEPT operator

How to use the Except Operator The EXCEPT operator is used to exclude like rows that are found in one query but not another.  It returns rows that are unique to one result.  To use the EXCEPT operator,...

View Article


Image may be NSFW.
Clik here to view.

Use SQL Server to Sort Alphanumeric Values

Sort Alphanumeric Values with SQL Server Recently a reader asked me how to sort an alpha numeric field in SQL in natural order.  Alphanumeric values are commonly found and don’t sort naturally using...

View Article


How do I combine results from several SQL tables (hint: there are three ways)

Many times in a relational database the information you want to show in your query is in more than one table.  This begs the question “How do you combine results from more than one table?” All the...

View Article

What is the Difference between ORDER and GROUP BY?

The GROUP and ORDER BY clauses are both used to organize data.  Learn which is used to sort the data, and which is used for counting and summing. All the examples for this lesson are based on Microsoft...

View Article

What is the difference between WHERE and HAVING clauses?

In this article learn when to use WHERE and HAVING.  Both perform similar functions, but for different purposes! All the examples for this article are based on Microsoft SQL Server Management Studio...

View Article


SQL Truncate and Delete

In SQL Server there are a couple a ways you can delete rows from a table.   You can use the TRUNCATE and DELETE command.  Though the end result of both commands is the same, there are very important...

View Article

Image may be NSFW.
Clik here to view.

Learn about Stored Procedures

What is a Stored Procedure? A stored procedure is a group of one or more database statements stored in the database’s data dictionary and called from either a remote program, another stored procedure,...

View Article

Image may be NSFW.
Clik here to view.

Subqueries – Introduction to a Subquery in SQL

The purpose of this article is to introduce you to subqueries and some of their high-level concepts.  There are a lot of details to cover in order to learn sub queries, but you’ll see we cover those...

View Article


Image may be NSFW.
Clik here to view.

Using Subqueries in the Select Statement (with examples)

This is the second in a series of articles about subqueries.  In this article we discuss subqueries in the SELECT statement’s column list.  Other articles discuss their uses in other clauses. All the...

View Article


Image may be NSFW.
Clik here to view.

What is a Database Trigger?

What is a Database Trigger? A database trigger is special stored procedure that is run when specific actions occur within a database.  Most triggers are defined to run when changes are made to a...

View Article

Image may be NSFW.
Clik here to view.

Using Subqueries in the WHERE Clause

This is the third in a series of articles about subqueries.  In this article we discuss subqueries in the WHERE clause.  Other articles discuss their uses in other clauses. All the examples for this...

View Article

Image may be NSFW.
Clik here to view.

Query Plans in SQL

All the examples for this lesson are based on Microsoft SQL Server Management Studio and the AdventureWorks2012 database.  You can get started using these free tools using my Guide Getting Started...

View Article

Image may be NSFW.
Clik here to view.

Using A Subquery in the FROM clause

This is the fourth in a series of articles about subqueries.  In this article we discuss using a subquery in the FROM clause.  Other articles discuss their uses in other clauses. All the examples for...

View Article


Image may be NSFW.
Clik here to view.

Get Ready to Learn SQL Server 23: Using Subqueries in the HAVING Clause

This is the fifth in a series of articles about subqueries.  In this article we discuss subqueries in the HAVING clause.  Other articles discuss their uses in other clauses. All the examples for this...

View Article

Image may be NSFW.
Clik here to view.

SQL Skills are Valuable, Learn why!

Are you serious about learning SQL?  If so, then get started with free tools using my Guide Getting Started Using SQL Server. Is SQL a Valuable Skill… is it Sought Out? If I was to say that SQL is not...

View Article


Image may be NSFW.
Clik here to view.

What is a SQL Server Data Dictionary?

What is a Data Dictionary? In SQL Server the data dictionary is a set of database tables used to store information about a database’s definition.  The dictionary contains information about database...

View Article

Image may be NSFW.
Clik here to view.

Learn the Three Crucial Steps to Writing Better SQL

You can learn to write SQL.  It isn’t hard.  Yes, there are many details to mind, but none of it is impossible.  In this series of articles I’ll show you the three steps I go through to write complex...

View Article


Image may be NSFW.
Clik here to view.

How to Write SQL – Understand Database Table Meanings and Relationships – Step 1

The first step to write SQL is to understand the database tables meanings and relationships.  This is important, as complex queries often span more than one table.  Knowing the purpose of the table and...

View Article

Write SQL – Formulate your Question – Step 2

To write SQL it is important to understand the question you wish to ask the database.  I know this seems pretty obvious, but you would be surprised how many people get tripped up on this step.  Some...

View Article

Image may be NSFW.
Clik here to view.

Write Better SQL – Step 3 of 3

To write sql, we’ll take all the information we’ve compiled in the previous articles and map it to the appropriate SELECT clause.  The series starts with this introductory article. All the examples for...

View Article
Browsing all 162 articles
Browse latest View live