Category: SQLBasics
-
Even More Fun with Database Keys
Over the last few posts, we’ve went over Primary Keys, Foreign Keys, Candidate Keys, and Alternate Keys. Most of y’all are probably thinking – that’s too many keys already! Why do we need even more keys? Well, that’s because we sometimes need different ways to describe what we’ve got going on. Of the four different…
-
More Fun with Database Keys
If you’ve been following along with some of our previous blog posts, you’ll know that we’ve discussed some of the more used keys when dealing with databases. Lest you forget, we talked about keys in these two blog posts: Primary Keys – Good and Bad Foreign Keys – Are they worth it? Now, we can…
-
Foreign Keys – Are they worth it?
Last time, we learned about Primary Keys and some of the goodness that they give you. If you missed that, remember to go back and read that here. This time, though, we want to focus on the close kin of primary keys – the foreign key. Foreign Keys are truly columns that point to the…
-
Primary Keys – Good and Bad
When it comes down to primary keys, most of us that have been working with databases for a while have come across a few million different ones. Some work fairly well. Some just don’t work at all and should be banned from ever being used as a primary key again. First, let’s delve into what…
-
Windowing Functions Exercises
So, using the Lahman’s baseball database – found here – let’s go thru some practice exercises to try out your new windowing functions skills: Find the first year that each park was played in Show the rank with ties (both ways) of the games started in 1983 for each league for all players Place the…
-
Processes
Every now and again, you’ll hear someone in IT say the word “process.” What does that really mean? Is it just a “black box” that data is shoved into and, magically, a file is created or a dashboard show you your data? According to Dictionary.com, a process is simply “a systematic series of actions directed…
-
Data Loss
In our last post, we quickly mentioned the phrase “data loss”. What does that really mean? Well, according to Wikipedia, data loss is “an error condition … in which information is destroyed by failures or neglect in storage, transmission, or processing.” The important part that I want to talk about there, is the “neglect in… processing.” Sadly,…
-
Try/Catch vs RAISERROR
Now I’m sure after the last post , you’re thinking “Oh, ever-so humble author, why, oh, why, would I pick one of these over the other?” Well, I’m glad you’re checking in today, because that’s exactly what we’re going over! Now, the easiest scenario is if the SQL Server you’re working with is somewhere between…
-
More ways to stop errors
Errors can be the bane of a developer’s existence. They can stop even the best developer’s work. A process that takes several hours can be stopped dead in it’s tracks in the last hour because of a horrible error. Thankfully, last time, we discussed one way to make a stored procedure more aware of errors…
-
Making Stored Procedures Bulletproof
So last time in Stored Procedures – Why we talked briefly about ways of making stored procedures more bulletproof. First off, you have to ask yourself, should we? I mean, the data we work with is a known thing every time, right? Can people just blindly enter data in? Haven’t our apps been built to…