Growing up I loved to watch science fiction, and I remember the premier episode of Star Trek1 on television. My dad and I sat down and we immediately fell in love with the entire crew of the Starship Enterprise. Of course, one of the critical crew members was not portrayed by an actor at all because it was the starship's computer. It turns out that the voice of the computer was none other than Majel Barrett-Roddenberry, the wife of Star Trek's creator, Gene Roddenberry.
It was amazing how the Enterprise crew could simply ask the computer a question to which it immediately responded in a human-like voice. Equally amazing was that the question(s) being asked of the computer didn't take on any special sequence or programming-like characteristics. There were no 'if this, then this', or such, just plain questions.
Of course, all of that was just 'science fiction', or was it?
Take a moment to look with me at the future of 'query'. Because just like the crew of the Starship Enterprise, I believe you will be 'chatting' with your computer and data before you know it.
But before we discuss the future of query, we need to make certain that everyone is on the same page when it comes to what a 'query' actually is. An expert once told me, "Murph's definition of a Query is simple...'a request for information from any set of data, information source, or database'." That sounds a lot like a question, just like those Captain Kirk asked of his starship's computer.
Long before we had Captain Kirk, the Starship Enterprise, and even simple computers we had vast resources for the stockpile of data, information and data-sets. Those resources were called 'libraries'.
Back in the old days when people went to the town library, rather than log-in to the internet, you would use a 'book' to get the information you needed. When is the last time you actually opened a book to find the answer to a question.
Accessing and reading of a book constituted a form of query. You were asking some question in your mind when you read through the pages of text in hopes of finding the answer. You might have been asking the 'atomic weight of cobalt', which can be found on page 273 of the 29th edition of the Handbook of Chemistry and Physics2 published in 1945. Or perhaps you wanted to know the gory details of the Clutter Family murders in 1959, as outlined within Truman Capote's 1965 novel, In Cold Blood3. In either case your effort to 'seek the information' was a query.
But regardless of the query you were trying to answer in one of the library's books, just finding the book took on the form of a query itself. You first had to open up the Dewey-decimal card index in order to identify where in the library your book was located. I would imagine that there are few of my readers who have never set foot in a library with a couple of hundred-thousand books and so, you can't imagine just how difficult it was to find a specific text in such a place.
For the last 20 years most of us, and especially all the youngsters who have grown up knowing nothing else, have relied on computers as our sources of information, especially since the 'internet' is ripe with what seems to be every piece of information know to mankind.
It's easy to make a query of the internet for almost anything we want to know today. But when it comes to a lot of computer programs we still must rely upon the foundations of 'query' to get to the information we need. In these cases query takes on one or more of three forms:
- Choosing Parameters from a Menu
- Query by Example
- Use of a Query Language
Choosing Parameters from a Menu
For most people using computer programs, like QuickBooks, this form of query is common to us all. For example just starting a query for specific information in QuickBooks typically involves making some selection from one of the program menu options.
Select a type of report from the QuickBooks menu is actually the start of a query.
QB Report menu - parameter selection query
Whether we are using QuickBooks or some other database or information source, this query type involves the source presenting us with a list of parameters from which we make a selection. This is perhaps the easiest way to pose a query because the menus guide us, but it is also the least flexible form of query.
Query by Example
This form of query involves the data source presenting us with a blank field that allows us to specify the value or values that define the query. An example of this would be the 'amount filter' found in some QuickBooks reports.
Query by example - QB Report Amounts
This QuickBooks filter allows us to query for a specific amount, or an amount equal to or less than some number, or an amount equal to or greater than some number, or even amounts between a high number and a low number. We just fill in the amount(s). That doesn't seem all that complicated, after all these are just 'amounts' within a specific limited set of data, our QuickBooks company file.
But what about access to a much larger set of data using query by example? As it turns out one of the most sophisticated 'blank fields' in which to just fill in the information you want lies at the front of one of the most sophisticated query engines. Their search for the answer engine has turned our use of query into making them one of the most wealthy businesses on the planet. Of course, I am talking about 'Google'4.
When you really take the time to think about it, the Google 'query' engine is so sophisticated to be able to find almost anything, anywhere, on the internet using just some 'tags' and optimization indexes that its web of spiders build as new data is added.
Using a Query Language
Query languages appear to most of us as some strange hieroglyphics that computer programmers and only a few others understand, just as with ancient Egyptian hieroglyphics. This sophisticated 'trash talk' that the computers understand take the form of stylized queries that are compiled in different query languages depending on what's native to the information source.
Stylized query usign SQL
Obviously this seems to be the most complex method of query because it forces anyone who wants to get to the data to learn one of these specialized languages. Of course with great knowledge comes great power and great responsibility. As such the programmers are many times more like 'jailers' keeping us confined from our data, and only permitting us to access what they want us to access, when they want us to access it.
This is very well the point where you maybe asking, "why does query have to be so complicates, so restrictive, and so dependent upon getting each request just right?" And that pretty much takes us right back to where I started all of this wondering...
If Captain James T. Kirk could simply 'ask' or 'tell' the computer on the Starship Enterprise what information he wanted, then why can't we? With the emergence of all of this Artificial Intelligence and Machine Learning by computers, it seems that we should be able to simply ask our computer for the data we need or want; after all, that data is resident within general ledger system.
And that dear readers is where the future of Query comes into play, but you will have to wait for part 2 of this mini-series to see just how science-fiction is becoming science-fact.
1 - Star Trek (original television series) created by Gene Roddenberry aired for three seasons on the NBC television network starting in 1966.
2 - Handbook of Chemistry and Physics, 29th Edition (1945), originally published in 1914 by the Chemical Rubber Publishing Company.
3 - In Cold Blood, a non-fiction work by Truman Capote initially published as a 4-part story in the New Yorker magazine in 1965, then as a novel published by Random House in 1966. Hailed by critics as the pioneering work in true crime genere, the book remains the 2nd all-time leading true crime book in publishing history.
4 - Google is an American multinational technology company, founded in 1998, specializing in internet-related services and products. The company's founders were a pair of PhD students at Standford University. Initially, Google was a web search engine designed to take simple typed native language queries and identify and display the information in a results page. As a result of the company's phenomenal growth it has expanded into, or acquired, numerous other products that build or expand upon the core search engine functionality.