The design of SQ-HAL can be broken down into three sections: database functionalities, natural language translation and user interface. Intended design for each of these three sections are explained in more details below.
Number of database functions need to be implemented for the operation of SQ-HAL. First it is required to establish a connection to the chosen data source. Since SQ-HAL is intended to be database independent, the implementation must support establishing connections to different types of databases. The data source may require user login. Therefore the program needs to know the current SQ-HAL user and his/her password to access the database. Except for password, all the other information (database type, data source and user name) needs to be saved for future use. Password however is required to be entered by the user every time user runs the program.
Before translating any English statements, it is essential to know the database structure. This structure can then be used to match tables and columns to the natural language queries. In order to know the database structure, SQ-HAL needs to retrieve table names, column names and column data types. Column data type is required to format the values in SQL statements as string values need to be quoted and date values need hashes (#) around the value. Since each user have different access privileges to the same database, the database structure visible to the user may differ from one another. SQ-HAL only needs to consider what is visible to the user, not the complete database structure.
The third database functionality required is the execution
of the translated SQL statements. Only SELECT queries are
executed and other types of SQL statements are not implemented in SQ-HAL.
One of the main reasons for this is that the SELECT queries do
not alter the database and therefore it is more secure against accidental changes.
Once the SQL statement is executed, the results have to be displayed to the
user. The results could either be an SQL error or a number of database
records. The maximum number of database records to be displayed must be
limited, as it is possible that the resulting record set may contain thousands
of records. Displaying such huge information is not required and it will
consume lots of computer resources.