SQL: Structured Query Language 6

Day 281 of writing every day.

My long weekend wasn’t spent productively in the sense of getting study time in, but I’m back on track again on the weekday.

I think that pushing myself along the textbook might be for the best rather than trying to master each chapter in one go. I can just come back and re-read the chapters when needed and focus on getting the bigger picture understandable to me first.

I’ve mentioned in previous posts how databases seem to require much more effort to do things Excel can, but that’s because I’ve only been introduced to the idea of looking at and working with a single database in action. Relational databases are perhaps the most practical way databases are actually used, joining data spread across different tables and called up to create the table set of data you need for whatever purpose you have with it.

Breaking down data and storing them as different components in separate tables when done properly, can optimize query speeds and updates. In private I don’t think we need to work with vast amounts of data containing thousands upon thousands of entries. That is unless you’re doing a lot of data work as a hobby. When it comes to handling searches and whatnot that go through perhaps hundreds of thousands of data entries, the best thing to do is codify a column and make a separate table that holds information on what the codes mean.

For example, rather than writing out the state name in full, we have an abbreviation system for every state in the US. In Japan there’s a prefecture code for all 47 prefectures. While the prefectures are represented in kanji that are just 2 or 3 full width characters long in Japanese, it might be a lot shorter to use a number code instead of displaying in another language. The concept applies with the two-letter abbreviation of states for the US.

Using these unique values that do not have duplicates, they can be used as keys introduced to other tables as foreign keys that allow the computer to connect the lines and call up data based on queries that make use of a key.

I’m still learning but it’s starting to come together for me.

Thanks for reading!

Leave a comment

search previous next tag category expand menu location phone mail time cart zoom edit close