Databases are very powerful means of storing and retrieving large amounts of data quickly and efficiently. There are many different commercially available database management systems used around the world. However getting data out of these databases is not an easy task. A special database interaction language called SQL (Structured Query Language) is used to communicate with these databases. Even though there is an ANSI standard for SQL, there are still minor differences between various database management systems, making it more difficult for even an experienced user to access data.
SQ-HAL is aimed at reducing this complexity of database querying. First it is necessary to use a language that is understood by anybody, whether an expert database programmer or person with no computer knowledge. The best-suited language for this purpose is the English language. This means SQ-HAL has to translate English or natural language queries into SQL before retrieving data from database.
In order to translate natural language, SQ-HAL needs to know the database architecture. This process is automated as much as possible to minimise the complexity to the user.
Database access privileges are different for each user. Therefore multiple user access has to be supported by SQ-HAL. Only database querying is implemented in SQ-HAL and database features such as adding, deleting or updating the data in the database is not considered at this point.
SQ-HAL is implemented as a computer software. It not only translates natural language queries into SQL statements, but also executes these to retrieve data from the database and displays them to the user. Simple user interface is also implemented thus making it easier for the users to use the program.
SQ-HAL is implemented as database and platform independent program thus adjusting to the minor differences between various databases.
SQ-HAL translates English sentences, phrases and keywords into SQL statements. It is also equipped with learning capabilities for the grammar that it does not understand.
Over the part decade, there were many similar projects has been carried out to translate natural language to SQL. Unlike SQ-HAL most of these are large-scale projects with years of research. Outcome of all these projects were commercially available software. A few of these projects are outlined below.
This was designed and implemented by Microsoft Cooperation as a part of the SQL server. It consists of two components: run-time engine to convert English queries to SQL and authorising tool for the initial setup of the database. [7]
Before proceeding with English query, database administrator uses the authorising tool to initialise database structure, create entities, define relationships between entities and to create verb phrasing for relationships. The database administrator required no knowledge of SQL in order to complete these tasks. [7]
Once the database is setup, English Query can translate very complex English queries to SQL with the capability of searching multiple tables and multiple fields. Following example demonstrated one of the complex SQL statement translated by English Query.
Example - "What hotels in Hawaii have scuba?" translated to [6]
SELECT DISTINCT dbo.HotelProperty.HotelName as "Hotel Name", dbo.HotelProperty.USReservationPhone as "Phone", dbo.HotelProperty.StreetAddress1 as "Street Address", dbo.HotelProperty.CityName as "City", dbo.HotelProperty.StateRegionName as "State or Region" from dbo.HotelProperty, AmenityNames, Amenities
WHERE dbo.HotelProperty.StateRegionName='Hawaii'
AND AmenityNames.Amenity='Scuba'
AND AmenityNames.AmenityID=Amenities.AmenityID
AND dbo.HotelProperty.HotelID=Amenities.Hotelid
The run-time engine can be included with COM (Common Object Model) supporting environment such as Visual C++, Visual Basic and Active Server Pages (ASP). This enables the English queries to be embedded in custom build software as well as for ASP supported websites. [6]
English Query however is available only for Win32 platforms and supports only data sources that has OLE DB provider such as Oracle and Microsoft Access. [6]
Developed by EasyAsk Inc., this is a feature packed application with natural language user interface. Initially developed as by Dr. Larry Harris in 1995, it was then called English Wizard. [8 pg 16]
Users can input their queries as keywords, phrases or complete English questions. This user input is then pre-process before translating to SQL. EasyAsk has its own dictionary and thesauruses which helps to correct spelling mistakes in the user input and to match synonyms. The ambiguous words are then clarified by asking the user for the expected meaning [8 pg 4].
EasyAsk also generates complex SQL. It can generate
sub-queries with HAVING clauses and complex ratios. It can
also match exact values or other SQL specific condition options such as LIKE,
EXIST, NOT EXISTS clauses and NULLs [8 pg
9]. It can automatically recognise table joins logics by looking at
database structure. Some of the other SQL related features includes
generating sub-select queries (query within another query), handling of
date/time yes/no questions and mapping abbreviations into proper values [8 pg
10].
Once the generated SQL statement is executed, output of the database results can be presented to the user in number of different forms. Some of these output formats are spreadsheets, cross-tabs, OLAP pivot tables, charts and graphs, ASCII files and product presentation templates for e-Commerce [8 pg 10-11]. The output required can be selected from the list or included in the user input.
Example - user input may look like "Pie chart of sales by region" which will represent the output data as a pie chart [8 pg 10].
EasyAsk supports variety of rational data sources including all ODBC data sources, Native SQL for Oracle, Sybase, DB3, Informix and SQL server. The application will only run in Win32 platform such as Window 95/98/NT [8 pg 16].
None of the above software are free nor they are available for any operating system other than windows. Also these software only support limited number of database types. SQ-HAL on the other hand will be available free and supports number of database types for windows as well as for other operating systems such as Linux.