We’ve finally made it to the last post in the SQL103 series. I’ve written posts about triggers before. I’ve shared with you how triggers can be good things and bad things. It’s all in how you design them. Today, I hope to teach you how you can design good triggers. Let’s dive right in! Understand…
SQL 103-Designing Stored Procedures
We’re nearing the end of the SQL103 series. We’ve designed tables, relationships, indexes and views. There’s plenty more to learn. Today we’re going to discuss designing stored procedures. When you start designing stored procedures you’re generally trying to build a wrapper around a collection of T-SQL statements that you can then hand off to developers….
SQL103 – Designing Indexes
So you’ve designed your tables, then you set up your primary and foreign keys. You even defined views that your programmers will use to present the data to end users. What’s next? Well, if you want to take a proactive approach to database design, you’re going to want to start thinking about indexing. Initial Indexes…
SQL103 – Designing Views
One of the next steps, after designing your tables is designing your views. You’ll often need to create them so that programmers will have access to the data in several tables, but you want to provide them an easier way to pull out the data. It’s a lot easier for them to use: SELECT *…
SQL103 – Prevent Dirty Data
Now that we’ve built relationships between our tables, we want to take the next step with our design is making sure the data stored in our tables is as clean as possible. The tool you’ll use for this insurance, is called a constraint. The good news is you’ve already learned one type of constraint.You’ve established…
SQL 103 – Relating Your Tables
Last time we were discussing how to build normalized tables. We designed 3 tables: Customer, Address and PhoneNumber. The Address and PhoneNumber tables are related to the Customer table, but how do we relate two tables? Primary Keys When we talk about relating one table to another, we’re really talking about relating a row…
SQL 103 – Normalized Table Design
So last time we were discussing the difference between normalized and de-normalized database design. We also discussed our case study, the CRM company. We decided to begin our database design by designing normalized tables to track customers and contacts with those customers. Let’s continue with that case today. We want to build tables to store…
SQL 103 – Introduction to Database Design and Architecture
I’m starting a new blog series to accompany the session I’m presenting at SQL Saturday #87 in Louisville! This session will cover the basics of designing a database from a developer’s point of view. During the class I’ll only have an hour, but in these blog posts I’ll be able to dig in a bit…
SQL103 – Normalized or Denormalized Design
When you begin designing a database, you start with the tables. You can’t very well start with views or stored procedures, right? What tables would they reference? When you begin designing tables, one of the first calls you’ll have to make is are you going to build a set of normalized tables or denormalized tables?…
SQL201 – Stored Procedure Results
I’m working my way through the last of the 201 lessons. Today we’re going to dive back into stored procedures. This time I want to cover the three ways you can get data back out. You can simply use a SELECT statement to return a record set, or you can define one or more of…