Difference between revisions of "Foreign Keys"

From Hostek.com Wiki
Jump to: navigation, search
(Created page with "==Are Foreign Keys Supported?== Yes. However they can only be created for InnoDB tables (not MyISAM tables, which are the default type). If you are creating your tables with ...")
 
(Are Foreign Keys Supported?)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
==Are Foreign Keys Supported?==
 
==Are Foreign Keys Supported?==
Yes. However they can only be created for InnoDB tables (not MyISAM tables, which are the default type).
 
  
If you are creating your tables with SQL queries, you would just have to add "TYPE=INNODB" at the end of
+
Information regarding whether database system support foreign keys, and requirements(if any) for their use.
the table declaration.
+
  
If you are using phpMyAdmin, you would just select
+
===MySQL===
InnoDB as the type when you create your tables.
+
'''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.
  
 
[[category:Databases-MySQL]]
 
[[category:Databases-MySQL]]
 +
[[category:Databases-MSSQL]]
 +
[[category:Databases-Access]]

Latest revision as of 16:44, 21 November 2012

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.