Matthew Helmke (dot) Net

Random things that interest me.

SQL and Relational Theory

June23

I have spent the last three or four weeks struggling through a book on relational database theory. Never content to know only the “how” of something, I wanted to learn some of the “why” behind SQL databases. This book covers that in depth, with a steep learning curve for someone like me who has a bit of experience using SQL in various applications, but who has never formally studied it. That is not a bad thing.

The book is SQL and Relational Theory: How to Write Accurate SQL Code by C. J. Date.

First, a bit of background. The author, C. J. Date, is well known in the field for his classic textbook An Introduction to Database Systems, which has gone through at least eight editions. He began working on databases in 1970 at IBM and worked with the inventor of the relational theory of database design, E. F. Codd. There is no doubt that this is a man who knows what he is talking about.

What this book sets out to do, in about 400 pages, is describe and define the relational model in greater depth and compare how SQL is currently used in many database applications like Oracle and MySQL to the theoretical ideal. As he does this, Date points out several inconsistencies with the SQL adaptation of the relational model and makes suggestions for how to adjust common usage to more closely conform to the ideal while acknowledging that at times perfect syncronization will be impossible using SQL. He also gives numerous examples of how it could be done in Tutorial D, which is an interesting study in itself.

I submit that this book is ideal for theorists, for highly qualified and experienced database administrators who want to learn at the feet of a sometimes emphatic and slightly dogmatic master who has been instrumental in the creation and spread of the relational database idea, but whose theory has not been perfectly implemented. If you merely want to know how to work within current implementation constraints without the larger picture, skip this book. If you want some fascinating, and sometimes difficult to grasp background and theory that will likely make you a better database wizard, this book is likely to help you get there.

Here are some highlights, sample questions and topics discussed in the book:

  • What are the differences between the relational model and the various product implementations available today and in the past?
  • Should a relational database allow duplicate entries?
  • Why are null values a bad idea?
  • What do relational expressions mean?
  • Why must database constraint checking be immediate, at least in theory, and why is it often deferred in practice?

Seriously, that is just the beginning. There are excellent examples of SQL code throughout the book, great discussions of the mathematics behind the genesis of relational theory, and more. Beware, though, you may have to work to understand it, but it will be worthwhile for those who do.

UN refugee officials accused of beating refugees in Morocco

June23

I’ve discussed the problems of racism in Morocco before. This is not a new issue, but one that needs to be brought to light more fully. Please read here for the full story, excerpted here.

By Daan Bauwens | Inter Press Service

RABAT, Jun 23 (IPS) – More than 300 African refugees are gathered at the gates of the Moroccan United Nations Refugee Agency (UNHCR), asking to be moved to another country because their rights are not respected in Morocco. Several refugees say they have been beaten up by Moroccan UN personnel.

On Tuesday morning, the refugees who are from Angola, Senegal, the Democratic Republic of Congo, Cote d’Ivoire, Liberia and some other countries, entered their ninth day of protest in front of the Moroccan office of the UNHCR in capital Rabat. Their numbers are steadily growing.

“We intend to stay here until our right to reinstallation is respected,” says Stéphane Gnako, spokesperson for the refugees. “We demand to be moved to a safe place where we are treated with dignity.”

According to the UN charter, every refugee has the right to be moved to another country if his or her rights are not respected in the country where they received asylum.

Many refugees in Morocco say they are caught in a trap. “Even though we are recognised by the UN as refugees, the Moroccan government does not want to grant us our rights,” Laura Thérèse from Cote d’Ivoire, who has been living in Morocco since 2004 tells IPS. “I’ve studied in this country, I have done an internship of three months, only to realise afterwards that I didn’t have the right to work.”

African refugees’ children have no right to education. “We have no right to integrate, no right to work, and no right to reinstall, so what are we supposed to do?” Laura Thérèse adds.

VMware Cookbook in Safari

June22

If you have a Safari account and are interested, some of the chapters of our upcoming book, VMware Cookbook, are available in Rough Cuts. We would love to hear your comments (and corrections, if necessary).

posted under General | No Comments »

Two upcoming titles

June22

Look for The Official Ubuntu Book, fourth edition to be released in July, and VMware Cookbook to be released in November. Both are currently listed on Amazon.com, and I have had the privilege of making major contributions to each.

I’ll post a little more about each as the release dates approach.

One of my books is in a library

June12

Or at least, it is about to be. I just found out that my book Humor and Moroccan Culture is being processed to be included in the Mohammed VI Library at Al Akhawayn University in Ifrane, Morocco. I hope it is the first of many, and that they find Nowhere Else to Turn equally worthy of being added to their collection.

Wordpress 2.8 upgrade

June11

I upgraded the site to Wordpress 2.8 today. It took about 30 seconds and involved clicking a link in the admin dashboard. That is amazing! Good work, WP devs, and thank you!

planet speed meme

June9

Here’s my entry.

This is over a wireless connection, through an early model Linksys wrt54g router running dd-wrt, while someone else is using a wired connection on the same router to watch videos on YouTube.

Twenty years ago

June4

In China, they marked the occasion by pretending it didn’t happen. I remember it.

Reading up on SQL

May30

About four weeks ago I read a manga introduction to databases that I enjoyed thoroughly and reviewed. As I mentioned in that review, that sparked an interest in learning more. I’ve used databases for years, and my simple level of experience has served me well, but now I want to know more. I decided to start by brushing up on my knowledge of SQL. The three books discussed in this article are a good introduction. I have another book on my shelf that goes deeper into database theory and I will review that book later. Let’s start with a brief introduction to each of today’s books, which will be followed by a short comparison.

First, I read sitepoint’s Simply SQL by Rudy Limeback.

I liked this book. It was easy to read and understand. I liked that the code focus is on using ANSI standard SQL as this gives knowledge that will work across platforms on multiple database systems from free options like MySQL to common proprietary ones like Oracle and SQL Server. The examples are clear and well written and the figures are wonderful (as is usual in sitepoint products).

This book is not intended for people who wish to learn to become database administrators. It was written for web developers who want to have a better understanding of the basics of SQL. This is an important fact. If you fit this role, this book is excellent.

The coding style was easy to read, but there were some odd quirks that I didn’t like. For example, as noted by the author himself, he likes to put commas at the beginning of lines when making lists. This is the only place I have ever seen that done. Now, this isn’t technically wrong, but it is unusual. I would have preferred to see code examples written with strict adherence to commonly accepted standards as this makes the task of reading other people’s code or writing good and readable code easier. However, I guess doing it this way can also be seen as a benefit as it will remind the reader that there is more than one way to do things, and that in the real world he will be sure to encounter non-standard methods and have to adapt. Honestly, that is my only big complaint about the book, and it isn’t a deal breaker.

Next, I read the new second edition of O’Reilly’s Learning SQL by Alan Beaulieu.

If a person is looking to become a database administrator, or just needs to get up to speed on the basics with some understanding of what they are doing and why, this is an excellent place to start. However, this book does require that you have some experience with computers, especially a base knowledge of what a database is and how or why programs might want to interact with one. This isn’t a book for someone who is a complete novice to the realm of data storage and interaction, but rather intended for people who know what they want to do and why and need an in depth manual for how to accomplish the task of storing, retrieving, and using data but who may be a complete novice at doing so using SQL.

I love that the book is written by a very experienced Oracle administrator, but uses MySQL (version 6.0! –the only book I have seen so far to do so since this release is so new) as the base for all examples and instruction. The book itself focuses on teaching the ANSI standard clearly and well, but gives great examples using one free and open source product that is available for any reader to download and install on their system, with instructions on how to do so. Then, the author discusses some of the differences that may be discovered by readers as they move into the real world and begin to interact with other database systems from other vendors.

The book uses examples that are well formed, clear, and which adhere well to standards. I especially appreciate that the examples use good coding technique that is easy to read and would be a joy to maintain in the wild if it were discovered by a person taking over responsibility for a database they did not create.

Finally, I picked up a copy of another O’Reilly book, SQL in a Nutshell by Kevin Kline with Daniel Kline and Brand Hunt, which just released a third edition that is greatly expanded

This book is intended as a reference, not an instructional text. It serves this purpose well with pages and pages of great examples. The book is not focused on databases and SQL from a specific vendor, but gives great data and comparisons of commands and queries using ANSI SQL (SQL2003, aka SQL3) and then adjusting as needed for MySQL 5.1, Oracle 11g, PostgreSQL 8.2.1, and Microsoft SQL Server 2008. If you are responsible for moving data from one vendor’s product to another, or if you are responsible for databases from multiple vendors, this book could be a Godsend. Really, if you only use one of these products, the book is still a great value.

Keep in mind, this is not an instruction manual. This is a compilation of commands with examples. The goal is not to lead gently, but to get directly to the meat of using SQL, to give clear and detailed information about each command, its syntax and options, and several examples of usage. If that is what you are looking for, and especially a book with comparisons across platforms, this book will serve you very well.

Conclusion/Comparison

Each of these books does a good job of fulfilling its goal of communicating to a specific audience. They all cover the basics, and the first two do a great job of teaching them in a logical and clear order, but in varying depth. If you are interested in learning SQL, hopefully this will help you determine if one of these offerings would be useful to you.

For people focused on web design and who only want to learn some of the basics, I feel quite good recommending Simply SQL. As with most of their offerings, this sitepoint book is dedicated to helping web developers improve their craft and they do a great job of serving that specific population. I was disappointed with the author’s decision to use his preferred coding style rather than the standard format, but the difference isn’t really so great as to be a huge problem.

I would imagine most people reading my blog would end up sharing my preference for Learning SQL. This second edition is clear, very well written, uses beautiful code examples, and has wonderful exercises at the end of each chapter (with solutions in the back of the book) to assist you in learning. I love how the book uses MySQL to teach, but doesn’t ultimately limit itself to only one database product and that the author has a wealth of real world experience using many products and takes time to discuss some of the differences without getting bogged down or too distracted from teaching good, portable ANSI SQL basics.

Finally, I don’t think the average person will have much use for SQL in a Nutshell, but for those who work with databases regularly, the book is sure to find a place of importance on the reference shelf. As I read through the examples, I appreciated how clearly and completely the different implementations of ANSI standards were delineated for each of the products covered and how differences from the standard were clearly noted and defined for each.

An interview with tinivole

May21

We have a musician to interview in this edition of our Ubuntu Community Interviews. Unsurprisingly, tinivole is also a pretty good guy and a wonderful addition to our forum staff. I think you will enjoy this conversation.

1. Tell as much as you’re willing about your “real” life – name, age, gender, location, family, religion, profession, education, hobbies, etc.

My real name is Iain Buclaw. I was born in Surrey, 1989, and am currently living in the West Midlands, UK. I have a European bound family with heritage roots from Italy and Poland, to which I’ve picked up enough of the Polish language to survive if I were ever to visit the country. My strengths are in Studio Engineering/Production and IT Support/Analyst roles; I am yet to decide which one to take on as a full-time career. I have vendor IT qualifications in CompTIA A+, Network+; Microsoft Certified DST; and Linux LPIC1. In my spare time I am a hobbyist programmer of the C and Perl languages, and spend whenever I can thrashing out Jazz/Rock on guitars.

2. When and how did you become interested in computers? in Linux? in Ubuntu?

I was a Music Recordist before I was a Computer Enthusiast, ever since the age of 12 using Cool Edit Pro2, and later Adobe Audition to record, track, layer and mix my own songs. That was until one day I had a sudden epiphany which motivated myself to learn programming. Of course, this sort of change didn’t happen over night, but after hours of playing with, and enjoying a software I bought called QuantumFX; which in a nutshell is a 5th Generation Programming IDE for making custom audio VST effect plugins, ranging from simple delays, to complex amp simulators.

At 16, I joined a Music Technology and an A Level Computing course at my local college. The practical elements of Computing were great, despite the course language of choice, VB6. That with added theory work in networking, programming paradigms and operating systems led me to stumble upon debian.org for the first time in my life, although it was to take another year before I initially installed my first Debian system. In the meantime, however, the course eventually because monotonous, so I ended up dropping out later during the second year, but continued on to get a BTEC Diploma in Music Technology.

By the time I had switch completely 100% Debian, Ubuntu Hardy Alpha1 was released, which just so happened to be the first time Ubuntu worked completely out of the box on my desktop system. The rest is history.

3. When did you become involved in the forums (or the Ubuntu community)? What’s your role there?

Almost immediately as I had installed Hardy Alpha1. Initially, I had a few questions to ask here and there about the operating system, and in the time waiting for replies, idolised by reading other support threads, occasionally answering to some of them. Over time as the number of solved posts increased, so did my enthusiasm to help/teach people.

After about 5 months of answering support threads, and some bumps into forum conversation with vor (aka sdennie) later, I received a private message from Joeb inviting me to join the Beginners Team. Since joining, I have seen the team grow and evolve from around a dozen active members to what now must be 40-50 active members. I now give support on both IRC and Forums, and have gotten involved in the Beginners-Dev and IRC Focus Groups within the BT team. Also, I would have been a key player in the Stalkers FG too, if such a FG existed, which it doesn’t.

4. Are you an Ubuntu member? If so, how do you contribute? If not, do you plan on becoming one?

I’m not currently a member, but I suppose, like many, it is something that I would like to apply for in the interim future. I haven’t really gotten involved in any LoCo group yet due to geographic constraints, but it’s something that may begin to happen as I relocate to better suited areas of Britain.

5. What distros do you regularly use? What software? What’s your favourite application? Your least favourite?

I run Debian 5.0 and Ubuntu 9.04, both installed from a Net boot disk, both of which are running 2.6.29 kernels with patches for real-time computing. Something I’ve slowly been adding to is to make a small recording studio setup in Linux without the bloat that other Studio distributions seem to be included with.

My favourite programs are vim and perl, if I were to naturally follow in the path of sdennie. I also have a liking to my own adapted version of an old abandoned pseudo C interpreter. kvm is another one for the good books, especially when used as a machine to test fixes/solutions before posting them. And ardour is a another brilliant application that deserves merit too. I don’t generally have a least favourite.

6. What’s your fondest memory from the forums, or from Ubuntu overall? What’s your worst?

Every time sdennie kicks me from a channel would be my fondest moment, more-so now as I can kick him back. Compiledkernel is another fond memory too, I always enjoy it when he is around IRC talking to new users. I can’t think of any notable things that happened on the forums, although nowadays I find myself digging up more and more old threads I posted solutions in. Be that a good thing or bad thing.

The first week of being a moderator on the forums and all the anxiousness that came with it was perhaps one of the worst weeks. There is a lot to take in, and quite steep amount of adjusting to do. The first time I confused Edit and Quote was a notable experience to elevate that, although perhaps quite humorous now I look back on it. My time on the forums since has only gotten better as my confidence grows in making important decisions, I now have a deep respect for the staff, and understand their sometimes undervalued role.

7. What luck have you had introducing new computer users to Ubuntu?

Haven’t really introduced Ubuntu to any new users as of yet, although I’ve had plenty of conversations with people who are either aware of Ubuntu, own a CD, or have tried it out in a VM, but haven’t yet taken the leap onto trying it out on a real partition yet. Have even had an interview where the interviewer was an Ubuntu user, which was fun. Since joining the BT and Forum staff, I have always included my voluntary work on my CV, and interviewers always pick it out first. I feel it is important for them to understand just what it takes to be in such a role.

8. What would you like to see happen with Linux in the future? with Ubuntu?

Further adoption and growth. Perhaps not on the Desktop for the time being, but in every other nook and corner of the Computer world.

9. If there was one thing you could tell all new Ubuntu users, what would it be?

Although we have collaborative works such as Ubuntu nowadays, it is always important to consider your own learning ability before trying out a new operating system. The Study Skills Handbook by Stella Cottrell is one such book I’d recommend to people looking to optimise their own learning abilities, as it has, at the very least, played a vital part in my education.

« Older Entries