There are many functions built in to SQL 2000. I’m not going to cover them all, since many of them you won’t have a need for until you really dig in deep with SQL programming. But there are seven you should really be familiar with. CASE You have no idea how much you’ll use the…
Tag: SQL101
SQL 101 – Date Manipulation Functions
Welcome back! This post is a followup to the post about string functions. The difference is this time, we’re discussing functions that manipulate dates. GETDATE The most often used function I can think of, with the possible exception of COUNT(*) is GETDATE(). When called this gives you the current datestamp from the server. This gives…
SQL 101 – Calculated Fields
When working with SQL you will inevitably be asked to return data from your database in a way it’s not stored. You’ll be asked to return city, state and zip as a single string, yet they are stored separately. You’ll be asked to return grand totals, but you only have line item totals. You’ll be…
SQL 101 – The Advanced LIKE Clauses
As I promised, this is my post on advanced LIKE clauses. Previously I’ve only shown you how to do a wildcard search that would act like the dos command “dir A*.*”, returning all the files that start with the letter A. But there is far more you can do with the LIKE operator. Wildcards themselves…
SQL 101 – SELECT, Filtering Results (Part 2)
In the previous post, I covered the WHERE clause. You should now feel pretty comfortable limiting the number of rows you get to return based on the values in a column. But I’m sure you’ve already asked “How can I limit based on two different columns?” I’m glad you asked! You can chain together your…
SQL 101 – SELECT, Filtering Results
After you learn how to get data out of a table with the SELECT command, you’ll soon ask the question, how do I limit the number of results I get back. Well, If you don’t ask the question, your DBA will. I don’t think he or she would like it if you only ever used…
SQL 101 – SELECT
The first thing you need to know when learning SQL is how to get data out of a database. This means learning the SELECT command. Using this command will get the SQL server to return data to you. You can use this command to do some simple math, or to do the common “Hello World!”…
SQL 101 – What is SQL?
SQL, pronounced S – Q – L or “sequel”, stands for structured query language. It’s the language you use to tell a database what you want to do. It’s been around since the early 1970s[1], so it’s pretty well established. One of the most awesome things about learning SQL is once you learn it, you…
SQL 101 – What is a Database
The term database is used for many different meanings. But if you compared them all, I think you would find that databases are all collections of data that are organized in some way. I usually like to refer to an Excel document when I try to explain databases. An excel file has a collection of…
SQL 101
After helping others learn SQL for several years now, I keep coming back to the same topics over and over. So, I decided to write down these SQL tutorials, and continually improve them over the years. What I’ve been able to collect here is just the introduction. This series is an introduction to Microsoft SQL…