Translate

Friday, February 28, 2014

MySQL

Maximum length of a table name in MySQL:

IdentifierMaximum Length (characters)
Database64
Table64
Column64
Index64
Constraint64
Stored Procedure or Function64
Trigger64
View64
Alias256 (see exception following table)
Compound Statement Label16


Storage Engine Features:

FeatureMyISAMMemoryInnoDBArchiveNDB
Storage limits256TBRAM64TBNone384EB
TransactionsNoNoYesNoYes
Locking granularityTableTableRowTableRow
MVCCNoNoYesNoNo
Geospatial data type supportYesNoYesYesYes
Geospatial indexing supportYesNoNoNoNo
B-tree indexesYesYesYesNoNo
T-tree indexesNoNoNoNoYes
Hash indexesNoYesNo[a]NoYes
Full-text search indexesYesNoYes[b]NoNo
Clustered indexesNoNoYesNoNo
Data cachesNoN/AYesNoYes
Index cachesYesN/AYesNoYes
Compressed dataYes[c]NoYes[d]YesNo
Encrypted data[e]YesYesYesYesYes
Cluster database supportNoNoNoNoYes
Replication support[f]YesYesYesYesYes
Foreign key supportNoNoYesNoNo
Backup / point-in-time recovery[g]YesYesYesYesYes
Query cache supportYesYesYesYesYes
Update statistics for data dictionaryYesYesYesYesYes
[a] InnoDB utilizes hash indexes internally for its Adaptive Hash Index feature.
[b] InnoDB support for FULLTEXT indexes is available in MySQL 5.6.4 and higher.
[c] Compressed MyISAM tables are supported only when using the compressed row format. Tables using the compressed row format with MyISAM are read only.
[d] Compressed InnoDB tables require the InnoDB Barracuda file format.
[e] Implemented in the server (via encryption functions), rather than in the storage engine.
[f] Implemented in the server, rather than in the storage engine.
[g] Implemented in the server, rather than in the storage engine.


What are indexes in a Database. What are the types of indexes?
Answer : Indexes are the quick references for fast data retrieval of data from a database. There are two different kinds of indexes.
Clustered Index
  1. Only one per table.
  2. Faster to read than non clustered as data is physically stored in index order.
Non­clustered Index
  1. Can be used many times per table.
  2. Quicker for insert and update operations than a clustered index.
What is the difference between Primary Key and Unique Key?
Answer : Both Primary and Unique Key is implemented for Uniqueness of the column. Primary Key creates a clustered index of column where as an Unique creates unclustered index of column. Moreover, Primary Key doesn’t allow NULL value, however Unique Key does allows one NULL value.
How many TRIGGERS are possible in MySql?
Answer : There are only six triggers are allowed to use in MySQL database and they are.
  1. Before Insert
  2. After Insert
  3. Before Update
  4. After Update
  5. Before Delete
  6. After Delete


No comments:

Post a Comment