Imagine trying to carry on a conversation with another person where you can only speak in complete and correct directives. Try to order a turkey sandwich with no mayo at a restaurant -
Customer: Select menu from Restaurant
Server: Select choice from customer
Customer: 0 records found
Customer: Select contents of turkey sandwich from menu.
Server: 2 slices of bread, 2 ounces of sliced turkey, lettuce, tomato, mayonnaise, salt and pepper.
Customer: Select turkey sandwich from menu where ingredient not equal to mayonnaise
Server: 0 records found
Customer: Select “2 slices of bread”, “2 ounces of sliced turkey”, “lettuce”, “tomato”, ”salt”, “pepper” from menu where choice = “turkey sandwich”.
Server: 1 record found. Select choice from menu
Customer: Select “Coffee with cream” from menu
Server: 0 records found.
Customer: Select “Coffee” from menu where condiments are cream
Etc., etc, etc.
Now try to imagine how you ask the server to bring a clean spoon.
SQL is a good structured language for applying set based logic to data stores. It is categorically bad for communicating. The worst problem with SQL is that there is no way to ask a question. You can write a SQL “query” which is not a query at all. It is a directive to the database system on how to process data sets and select records to be returned to you.
When a person asks a question it is usually because they don’t know the answer. With SQL based queries you must know exactly the answer you need before you can properly prepare the query.
If you ran out of stock for an item yesterday, a natural human question is “What happened yesterday?” Sorry, that can’t be written in SQL. You can select all orders from yesterday. You can sum them by product and compare the sales to last year. You can review all sorts of facts when you know which facts you need but you can’t ask what happened yesterday. But if the answer to your real question is not in the orders, none of the SQL queries will provide the needed answer. The important information could be in orders but it could be in inventory, receipts or some other table.
With Illuminate you can have partially complete questions where some or even all of the qualifications are not yet known. For example “find 7/24/2010”. You can see the result of the partial question and formulate the next step in the investigation. This is the train of though problem solving process that is completely natural to people but simply not possible with SQL.
No comments:
Post a Comment