Showing posts from July 5, 2020

The Book of Three

Instead of reading more of my SQL book, I read The Book of Three by Lloyd Alexander. It was a fun fantasy tale for young adult audiences, and I thoroughly enjoyed reading it this morning. Being a young adult novel, I was able to easily get it done in about four hours and would recommend it to anyone older than, say, 10 or so, as it's very approachable. The only gripe I have deals with the fact that the author would choose to have dialogue like: "Why did Event X happen?" "Event X happened because Event Y happened - and there is no time to explain Event Y!" Perhaps the author chose this to keep his books short, or to keep the action going, or just to not deal with the possibility of plot holes. There are four more books in this series that I'll read throughout the summer. I'm looking forward to continuing the story and reading how the protagonist matures. But tomorrow, I'll continue on with Query Optimization in my SQL book. Much drier read, but I

Dynamic SQL

I read through the chapter on Dynamic SQL that touched briefly about SQL injections, and then I went through the exercises and lesson review questions. Looks like I need to read the QUOTED_IDENTIFIER section - I only got one of two answers correct. It seems I do better and remember more if I type out all the exercises, which reminds me of the reason why I did better on my Business Law final exam over the midterm - I wrote down key terms, which is kind of what I'm doing here by typing out all the exercises and examples. The dry material is a little tough to get through even though the subject itself is interesting. I just need to do more examples in order to cement more information. I'm also a little tired of reading SQL every night, and I might need a day's rest from it. Every night after working with SQL, I've been reading and doing exercises in SQL between 1 and 3 hours, and I'm thinking Saturday I'll read something else that doesn't start with USE T

T-SQL Error Handing Part 3 and Managing Transactions and Concurrency and Chocolate Truffles

The last exercise in the lesson about error handling, as well as the lesson questions at the end were rather easy, luckily. I finished those up, then decided that I should try making chocolate truffles. Yep. Two ingredients - a can of sweetened condensed milk and a cup of cocoa powder. I used a pan and metal bowl in lieu of a double boiler. I put in about two cups of water and turned on the burner, and gathered the rest of the ingredients and utensils while waiting for the water to boil. I poured the sweetened condensed milk in the bowl and started whisking away. Pretty soon, it was getting thin, so I slowly added the cocoa powder through a fine mesh strainer and incorporated it in the milk. It was looking great! Just the last 1/3 cup of cocoa powder to go. Then you know what happens whenever you deal with chocolate and a heating source. It seizes up. Sludge. I've got about a 1/6 of a cup of cocoa not incorporated and a bowl of chocolate sludge. That's what I get for wo

T-SQL Error Handling Part 2

Well, I handled my own error! I went back to the exercises, and executed just part of the second exercise that had an issue with completion, and it swiftly completed. Confused but pleased, I executed the entire second exercise and it completed. How can that be, since it didn't complete yesterday? Then, I noticed the window with the first exercise was disconnected from the database since I'd put my computer to sleep last night, and I read through the code again. It didn't end with a ROLLBACK or COMMIT, so while it showed an error, the transaction was still running. When I tried to run the second exercise, it was still waiting on the first to complete since I was updating the same table. I tested my hypothesis, ran the first exercise, ran the second exercise, and ran sp_who2. Just as I thought, the second exercise was being blocked by the first. I killed the session that held the first exercise, and the second exercise completed. I added ROLLBACK to the first exercise, it c

T-SQL Error Handling, and a very successful run

Yesterday evening, I read the six pages on Error Trapping. It was quite dry and difficult to remember all the syntax, but I powered through with reading it and started to work on the exercises. I found a website with download links for all the code and the sample database . I ran the script to create the database and insert the data. The first exercise showed a Primary Key violation with a duplicate key insert. I typed out the code and ran it, and it came back in less than a second with the very error they expected. The second exercise expounded on the first. Two insert statements this time, with the first insert looking as a copy of the first exercise - the insert should fail due to a primary key violation, and the second insert to succeed. However the point of the second exercise was to show that even though the first insert fails, the engine continues and inserts the second insert statement when the desired action is for SQL Server to stop and rollback the entire transaction. Un

What I have yet to learn for the first SQL exam

I found a link of what skills will be measured on the 70-761 Querying Data with Transact SQL exam . I know I need to learn these concepts : Error handling I need to know these facts (I understand the concepts already, but just need to know specifics of using them): How and when to use APPLY, GROUPING SETS, CUBE, ROLLUP, PIVOT and UNPIVOT. I need to know these procedures : I have to practice creating table-valued and scalar-valued functions, and query and output JSON and XML data. (Previously, I thought the XML bit had been left off this new version, but apparently, it has not!) Now I know what chapters I'll focus on this week in the book, which includes a sample database to go through all the concepts in the book, so I can practice and not just read about the areas where I'm lacking. Next week, I'll take a practice test and see how I fare.

Chapter 4 of Ultralearning: Metalearning

I've read about metalearning (learning beyond, not gaining something from metal) before from several different productivity authors, but Scott Young has done an excellent job in this chapter, as before, I felt metalearning was explained thusly: Metalearning is learning the concepts that are what you need to know to get the best bang for your buck, like "example 1" or "example 2" and you should have an idea of where to go and how to get it. Errr, but I don't know where to go or how to get it! How am I supposed to understand what and how to study most efficiently if I don't know the subject area? Without those answers, and with the feeling of metafailure, I was confused and just gave up. However, this book looks to be different. Young explains metalearning as an experiment and as a skill . The first time I apply metalearning, it might not reap huge benefits, but it hopefully will reap more than not doing it at all. And as I continue to use metalearn