Foreign Keys

From Hostek.com Wiki
Jump to: navigation, search

Are Foreign Keys Supported?

Information regarding whether database system support foreign keys, and requirements(if any) for their use.

MySQL

MySQL supports foreign key relationships. However, they can only be created for InnoDB tables (not MyISAM tables, which are the default type).


NOTE:

If you are creating your tables with SQL queries, you would add TYPE=INNODB at the end of the table declaration to create the table as an InnoDB type.

If you are using phpMyAdmin, you would select InnoDB as the type when you create your tables.


MSSQL

Microsoft SQL Server supports foreign key relationships.


Microsoft Access

Microsoft Access supports foreign key relationships.