Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the KEY keyword mean?

Tags:

indexing

mysql

People also ask

What is key keyword?

Definition of key word : a word that is a key: such as. a usually keyword \ ˈkē-​ˌwərd \ : a significant word from a title or document used especially as an index to content. b : a word exemplifying the meaning or value of a letter or symbol.

Is primary key a keyword?

A primary key, also called a primary keyword, is a key in a relational database that is unique for each record. It is a unique identifier, such as a driver license number, telephone number (including area code), or vehicle identification number (VIN). A relational database must always have one and only one primary key.

What is primary key and foreign key?

A primary key generally focuses on the uniqueness of the table. It assures the value in the specific column is unique. A foreign key is generally used to build a relationship between the two tables. Table allows only one primary key.

How many keys are there in SQL?

Practically in the database, we have only three types of keys Primary Key, Unique Key, and Foreign Key.


Quoting from create-table - indexes andkeys

{INDEX|KEY}

So KEY is usually an INDEX

KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.


KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.

column_definition:
      data_type [NOT NULL | NULL] [DEFAULT default_value]
      [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]
      ...

Ref: http://dev.mysql.com/doc/refman/5.1/en/create-table.html