SQL Server and English Query

English Query provides an OLE Automation API that lets users resolve natural-language questions about the information in a Microsoft® SQL Server™ database.

Given a definition of the entities and relationships associated with a SQL Server database, English Query translates a natural-language question about data in the database to a set of SQL SELECT statements that can then be executed against the SQL Server database to get the answer.

For example, given a car sales database, an application can send English Query a string containing the question, “How many blue Fords were sold in 1996?”

English Query returns to the application an SQL statement such as:

SELECT COUNT(*)

FROM CarSales

WHERE Make = 'Ford'

  AND Color = 'Blue'

  AND DATEPART(yy, SalesDate) = '1996'

  

The application can then execute the SQL statement against the SQL Server database to get a number it can return to the user.

English Query works best with a normalized database. There are two parts to using English Query in an application:

  1. An administrator defines an English Query domain for the database and uses that to compile what is called an English Query application file. The English Query application file is what defines the structure of the database to the English Query run-time engine.

    An English Query domain contains:

  2. The domain is defined with a domain editor and tested with a test tool. The result is saved as a domain project (or *.eqp file). This file is compiled to form the English Query application file (*.eqd).

English Query is an OLE Automation server that can be called from any OLE Automation application. The OLE Automation server, or run-time engine, exposes an object model API. An OLE Automation application uses the API to load the English Query application file and then send the run-time engine natural-language questions. The run-time engine usually returns an SQL statement or batch that will retrieve the needed information from the SQL Server database. Sometimes the run-time engine can provide the answer directly, request clarification, or return an error.

See Also

Installing English Query

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.