MySQL RDBMS is the most popular opne source database used mainly with PHP and another online applications. Here is some most commonly asked interview qyestions collections about MySQL. Download Complete PHP Faqs in PDF.If you are a PHP programmer or an online software developer, you should be thorough with basic RDBMS ( Relational Databse Management system ). The questions you can expect from this topic are about
- Creating, deleting, altering Databases and tables
- Connection with database
- Primary keys , index keys and foreign keys
- How you start designing tables as per the requirement
- Selection query
- Optimizing the queries with left and right join
- Aggregating functions like SUM
- Selecting the unique rows
- avoiding the duplicate rows
- Search in Mysql table
- Technical features and General knowledge topics about MySQL
Most of the companies are working with this MySQL tables and there are a lot of job chances in this field as database administrator and programmer. Please go through all of these followed questions with their answers before attending the interview.
MySQL is an open-source relational database management system (RDBMS). The name is derived from a combination of “My” which stands for the name of the daughter of the co-founder Michael Widenius, and “SQL” which is stands for Structured Query Language.
MySQL is owned by Oracle, though initially owned and sponsored by a single for-profit firm, the Swedish company MYSQLAB. The MYSQL development project makes its source code accessible under the GNU General Public License terms, including a range of propriety agreements. You can get various paid editions with additional functionality for propriety use.
MySQL interview questions and answers
Writing MySQL exam can be a bit tricky. But if you are getting set for an interview, here are a few possible questions you might be asked and their answers.
- What is MySQL?
MySQL is an open-source DBMS that is built, supported and distributed by MySQL AB. It is now owned by Oracle.
- Why do we use MySQL?
MySQL database server is dependable, fast and user-friendly. One can download the software from the internet and as freeware.
- What is the default port for MySQL Server?
The default port for MySQL server is 3306
- What is REGEXP?
REGEXP is a pattern match in which matches pattern anywhere in the search value
- What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?
When the table is created, Zero is used for updating the TIMESTAMP column. UPDATE CURRENT_TIMESTAMP modifier updates the timestamp field to current time whenever other fields of the table are changed.
- What does myisamchk do?
It is used for compressing the MyISAM tables thereby reducing their disk or memory usage.
- What do you understand by federated tables?
They let you have access to the tables which are located on other databases on other servers.
- How do we find out the auto increment that was assigned on Last insert?
LAST_INSERT_ID will return the last value assigned by Auto increment and it not mandatory for the table name to be specified.
- How do you login to MySQL using Unix shell?
To login, we can make use of this command:
#[mysql dir]/mysql –h hostname –u<UserName> -p<password>
- Differentiate between CHAR_LENGTH and LENGTH
While CHAR_LENGTH is character count, the LENGTH is a byte count. The numbers are the different for Unicode and other encodings but the same for Latin characters.
- How can you see all the indexes defined for a table?
You can define indexes for the table by:
SHOW INDEX FROM <tablename>;
- What are the column comparisons operators?
The =, <>, <=, <, >=, >, <<, >>, <=>, AND, OR, or LIKE operators are used in column comparisons in SELECT statements
- What is InnoDB?
InnoDB is a transaction safe storage engine developed by Inno Oy, now Oracle Corporation.
- How many columns can you use in creating Index?
You can only create a maximum of 16 indexed columns for any standard table
- What do you mean by % and _ in the LIKE statement?
% corresponds to 0 or more characters. But _ is exactly one character in the LIKE statement.