• +91 9723535972
  • info@interviewmaterial.com

My SQL Interview Questions and Answers

My SQL Interview Questions and Answers

Question - 31 : - Explain the difference between MyISAM Static and MyISAM Dynamic. ?

Answer - 31 : - In MyISAM static all the fields have fixed width. The Dynamic MyISAM table would include fields such as TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to restore in case of corruption, since even though you might lose some data, you know exactly where to look for the beginning of the next record.

Question - 32 : - Explain advantages of InnoDB over MyISAM?

Answer - 32 : - Row-level locking, transactions, foreign key constraints and crash recovery.

Question - 33 : - What are HEAP tables in MySQL?

Answer - 33 : - HEAP tables are in-memory. They are usually used for high-speed temporary storage. No TEXT or BLOB fields are allowed within HEAP tables. You can only use the comparison operators = and <=>. HEAP tables do not support AUTO_INCREMENT. Indexes must be NOT NULL.

Question - 34 : - What are CSV tables?

Answer - 34 : - Those are the special tables, data for which is saved into comma-separated values files. They cannot be indexed.

Question - 35 : - What is SERIAL data type in MySQL?

Answer - 35 : - BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT

Question - 36 : - What happens when the column is set to AUTO INCREMENT and you reach the maximum value for that table?

Answer - 36 : - It stops incrementing. It does not overflow to 0 to prevent data losses, but further inserts are going to produce an error, since the key has been used already.

Question - 37 : - Explain the difference between BOOL, TINYINT and BIT. ?

Answer - 37 : - Prior to MySQL 5.0.3: those are all synonyms. After MySQL 5.0.3: BIT data type can store 8 bytes of data and should be used for binary data.

Question - 38 : - Explain the difference between FLOAT, DOUBLE and REAL. ?

Answer - 38 : - FLOATs store floating point numbers with 8 place accuracy and take up 4 bytes. DOUBLEs store floating point numbers with 16 place accuracy and take up 8 bytes. REAL is a synonym of FLOAT for now.

Question - 39 : - What happens if a table has one column defined as TIMESTAMP?

Answer - 39 : - That field gets the current timestamp whenever the row gets altered.

Question - 40 : - Explain data type TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ?

Answer - 40 : - The column exhibits the same behavior as a single timestamp column in a table with no other timestamp columns.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners