Breaking News
Loading...
Saturday 6 August 2011

Mysql Interview Question and Answers 5

00:22
41. How do you find out which auto increment was assigned on the last insert?
SELECT LAST_INSERT_ID() will return the last value assigned by the auto_increment function. Note that you don’t have to specify the table name.

42. What does TIMESTAMP ON UPDATE CURRENT_TIMESTAMP data type do?
On initialization places a zero in that column, on future updates puts the current value of the timestamp in.

43. How many drivers in Mysql?
There are eleven drivers in MYSQL .Six of them from MySQL AB and five by MYSQL Communities.They are
  • PHP Driver
  • ODBC Driver
  • JDBC Driver
  • ado.net5.mxj
  • CAPI1PHP DRIVER
  • PERL DRIVER
  • PYTHON DRIVER
  • RUBY DRIVER
  • C WRAPPER
44. How do you run batch mode in mysql?
mysql < batch-file >;
mysql < batch-file > mysql.out

45. What Storage Engines do you use in MySQL?
Storage engines used to be called table types.
Data in MySQL is stored in files (or memory) using a variety of different techniques. Each of these techniques employs different storage mechanisms, indexing facilities, locking levels and ultimately provides a range of different functions and capabilities. By choosing a different technique you can gain additional speed or
functionality benefits that will improve the overall functionality of your application.

46. Where MyISAM table is stored?
Each MyISAM table is stored on disk in three files.
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension

47. Define Primary key?
MYSQL allows only one primary key. A primary key is used to uniquely identify each row in a table. It can either be part of the actual record itself.A primary key can consist of one or more fields on a table.
When multiple fields are used as a primary key, they are called a composite key.

48. Explain the difference between BOOL, TINYINT and BIT ?
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.

49. What are CSV tables?
Those are the special tables, data for which is saved into comma-separated values files. They cannot be indexed.

50. Explain the difference between MyISAM Static and MyISAM Dynamic ?
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 incase of corruption, since even though you might lose some data, you know exactly where to look for the beginning of the next record.LOB, 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.



Share This :
Tags:

0 comments:

Post a Comment

 
Toggle Footer