What's different between INDEX and KEY in database Tuesday, October 13, 2009

INDEX:
An index is a database feature used for locating data quickly within a table. Indexes are defined by selecting a set of commonly searched attribute(s) on a table and using the appropriate platform-specific mechanism to create an index.
for example, Personnel information may be store in a Human Resource department's employee table. Clerks find that they often search the table for employees by last name but get slow query responses. Defining an index on the table consisting of the last name attribute would speed up these queries.

KEY:
A database key is a attribute utilized to sort and/or identify data in some manner. Each table has a primary key which uniquely identifies records. Foriegn keys are utilized to cross-reference data between relational tables.



0 comments: