Blog Archives
Question of the Day Four
Let us continue our question of the day series with day four.
What is the difference between a primary key and a unique key?
The unique key and the primary key designation both enforce that the particular column is unique. However, the primary key will create a clustered index using that column and a unique key will create a non-clustered index. This is the fundamental difference in the two. Another minor difference is that the unique key allows you to have one null value and the primary key does not allow any use of the null value.
Enjoy!
Question of the Day Three
Today we continue our Question of the Day series with question number three. In case you are just joining us, we are doing a question a day as an exercise in SQL Learning.
What is fill factor?
My first response to this question in normal day-to-day conversation is that fill factor is a great SQL guy that I follow on twitter. All joking aside, fill factor is an option that will determine how full to create each index page. In other words, when the index page is filling up and does not have enough room to insert a new row, then SQL Server will generate a new index page and move some of the rows from the last index page to this new page. This is known as a page split. If we use the fill factor option, then the server will reserve a set amount of space on each index page and thus will reduce the number of page splits. The default value for fill factor is 0.
Enjoy!
Question of the Day Two
Today we continue our series with our second question of the day.
What is the difference between a clustered and non-clustered index?
In simplest terms, a clustered index is the actual data, reordering the way that the records are physically stored. Because of this, each table can only contain one clustered index.
However, a non-clustered index is more like a pointer to the actual record. The logical order of the non-clustered index does not usually match how the data is stored physically.
There is also a third option, the heap, which is a table without an index at all. Without an index, the server would have to read through all of the records in order to find the data queried. Enjoy!
Question of the Day One
For the next week, I will be on vacation and then when I return I have a big project that needs my full attention. However, being dedicated to blogging daily I thought it might be an interesting little journey for remainder of the month of August would be to post a question of the day with the answer. I am not trying to steal any thunder from the SQL Server Central QotD where you test your skills for points against the world. This will be simply an exercise in SQL learning.
So let us begin with day one…
What is normalization?
In simplest terms it is the organizing of data in a relational database to reduce the duplication of data. In order to accomplish this we would split one large record entity into smaller tables that are linked by their relationship. For example, if you had a simple database that stored orders of widgets. You would have a table that contained customer data and a table for order information. You would not want to store customer contact information in each record of the order table. There would be one customer record and then possibly multiple order records linked by a customer ID field to ensure a relationship and preventing you from redundant customer contact information in each order record. However, to the user who receives an invoice that contains his order and his contact information the data seems to be one contiguous unit.
Just in case you did not know, this theory was pioneered by E. F. Codd in 1970. Enjoy!
Saturday SQL Schoolhouse
Today’s installment of the Saturday SQL Schoolhouse is brought to you by the fine folks over at Idera Software. They offer free webcasts broadcast usually monthly with some of the biggest names in SQL Server. Better yet, is that all of those are archived here for your viewing and learning pleasure.
Check out this month’s webcast, recorded earlier this week by my friend Robert Davis (blog|twitter). In addition, they also have SharePoint and PowerShell webcasts for your learning goodness. Enjoy!
SQL Schoolhouse: Myths and Misconceptions Reading
Paul Randal (blog|twitter) did a wonderful month-long series on the Myths and Misconceptions with SQL Server a couple of years back and I thought it would make an excellent read for the Schoolhouse. Here is the link for the 60 page completely documented PDF version of the blog series. Enjoy!
Saturday SQL Schoolhouse, Case Studies
Today’s installment of the Saturday SQL Schoolhouse is brought to you by the fine folks over at Microsoft. When searching for a topic to “teach” today in the schoolhouse, I came across this site called Microsoft Case Studies and could not stop reading. Obviously, it makes perfect sense for Microsoft to create such a page to help business see the correlation between their products and solving the problems that they have.
Being a SQL geek, I was enthralled like when you are reading a good spy novel wondering if the migration was successful, did the BI solution solve their reporting quandary, did the cloud really save them millions in unnecessary overhead. Forget the kindle, pick up a good case study and it may help you solve a problem you are having in your office. Enjoy!
SQL Reference Book Favorites
While looking up something in the racecar book, I thought the topic would make a great blog post. What books stay on your desk? I have a book shelf full of wonderful books that are written by people smarter than me. However, there are four books that never return back to the book shelf mainly because they are my “go to” books of choice. They rarely fail me in my time of need. The first being my training manual for the SQLskills Immersion Event for Internals and Performance (aka IE1). If you have taken this class, then you understand why this never leaves my desk. The second manual is affectionately called the racecar book. It is the actually called Professional SQL Server 2008 Internals and Troubleshooting and is the first book that I open when I have a question. The third book is a new book called Troubleshooting SQL Server, A Guide for the Accidental DBA. I am currently reading this book, but I think it will stay on my desk for some time to come. The final book is Pro SQL Server 2008 Failover Clustering because I have yet to see another book for clustering that covers everything under the sun. Now don’t get me wrong, eBooks are great, but it still does not beat a real book, maybe I am just old school. What books remain on your desk?
Saturday SQL Schoolhouse, MS TechEd
Today’s installment of the Saturday SQL Schoolhouse is brought to you by the fine folks over at Microsoft TechEd which was held last week in Orlando. Didn’t get to go to TechEd this year, me either. But that’s fine because we have the next best thing though, all of the sessions online! Top Rated Sessions at TechEd North America 2012.
Enjoy!
We Survived SQL Saturday #132, Pensacola
Relaxing in a Tallahassee Spring Hill Suites, I am reflecting on this weekend’s trip to Pensacola. Why Tallahassee? This SQL Learning trip was turned into a long weekend with my wife. We decided to split our long ride home in half and enjoy an extra day unwinding, relaxing in the pool in sunny Tallahassee especially since we did not get to enjoy the beautiful beaches of the Gulf Coast. We are already planning to return to Pensacola for next year’s SQL Saturday.
After yesterday’s flooding with the declaration of the state of emergency and driving around a flash flood only to find myself in an intersection that was about 18 inches deep, I can easily say that we survived SQL Saturday #132. However, I wouldn’t trade the experience as I arrived back at the venue in time to give my first ever presentation (I left because I was soaked from head to toe in order to put some fresh dry clothes on). I also got to spend some time with a couple of great MCMs and meet a handful of new people to add to my #SQLFamily.
Next week, after I return home from this trip, I will blog some of the things I learned in some of the sessions and the pre-con. Until, then relax and enjoy the rest of your weekend!




