October 11, 2018

Sreekanth B

Polaris MySQL Most Frequently Asked Latest Interview Questions Answers

How important is to list the column names when doing an INSERT?

It is not important to list the column names when doing using an INSERT command as you can provide the column information and values in the table in the same order in which they appear in the table structure. It is safer and convenient way to specify the column names as it will keep the count of the column you are visiting.

Where’s database data actually stored? Is there a way to see the files which are stored?

Database data is usually get stored in the computer hard-disk and you can manage the data by the database program like MySQL and phpAdmin. The files can be seen but database files remain in binary format so it can be opened and read but, you have to put extra effort to understand it. SQL is given for the purpose of interacting with the database and read the database and retrieve the information out of it.

Why to use CHAR instead of VARCHAR in the database?

CHAR is much more accurate and efficient to use. CHAR doesn’t have to keep a count of the variable length. It is more efficient when you have to use it for a text column which is of an exact length. Char is used for the data which are fixed, but VARCHAR is used for data like password, which are variable.

What are ENUMs used for in MySQL?

ENUM is used to limit the possible values and store it together. It is a function that can be created to store the similar values together. It is used in creation of table.

The syntax of it is as follows:
CREATE TABLE months (month ENUM “January”, “February”, “March”,…);
INSERT months VALUES (“April”);
Polaris MySQL Most Frequently Asked Latest Interview Questions Answers
Polaris MySQL Most Frequently Asked Latest Interview Questions Answers

What is the purpose of -> in the MySQL terminal?

-> prompt in the command of MySQL indicates that a single statement is being entered across multiple lines. From this prompt MySQL interprets that you haven’t finished entering the statements. It has no impact of enter which you might press to go to the next line. MySQL will execute the statement only when you will insert the semicolon in the end which it recognizes.

How to find the unique values if the value in the column is repeated?

If the values in the column of a table are repeating and a unique value has to be found then the following command can be used in the query:
SELECT DISTINCT user_firstname FROM users;

There is another command which can be used to find the command to see the distinct values as:
SELECT COUNT (DISTINCT user_firstname) FROM users;

When to use ORDER BY in DELETE statement?

The ORDER BY clause in DELETE statement is used when a deletion has to take place by in a specified order.

The syntax is like this
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
ORDER BY
clause is specified, the rows are deleted in the order that is specified.

What is the difference between Unix timestamps and MySQL timestamps?

The unix timestamp is stored as 32 bit integer whereas, MySQL timestamps are stored in 32 bit integers but represented differently then UNIX timestamps like YYYY-MM-DD HH:MM:SS format. Unix timestamp is given as month-day-year-HH:MM:SS..

Why Do We Use Mysql Database Server?

The MySQL database server is very fast, reliable and easy to use. You can easily use and modify the software. MySQL software can be downloaded free of cost from the internet.

What Are The Different Tables Present In Mysql?
There are many tables that remain present by default. But, MyISAM is the default database engine used in MySQL. There are five types of tables that are present:

MyISAM
Heap
Merge
INNO DB
ISAM

What Are The Differences Between Mysql_fetch_array(), Mysql_fetch_object(), Mysql_fetch_row()?

Mysql_fetch_object is used to retrieve the result from the database as objects while mysql_fetch_array returns result as an array. This will allow access to the data by the field names.
For example:
Using mysql_fetch_object field can be accessed as $result->name.
Using mysql_fetch_array field can be accessed as $result->[name].
Using mysql_fetch_row($result) where $result is the result resource returned from a successful query executed using the mysql_query() function.
Example:
1.$result = mysql_query("SELECT * from students");
2.while($row = mysql_fetch_row($result))
3.{
4.Some statement;
5.}

How Do You Backup A Database In Mysql?

It is easy to backing up data with phpMyAdmin. Select the database you want to backup by clicking the database name in the left hand navigation bar. Then click the export button and make sure that all tables are highlighted that you want to backup. Then specify the option you want under export and save the output.

What Is Sqlyog?

SQLyog program is the most popular GUI tool for admin. It is the most popular MySQL manager and admin tool. It combines the features of MySQL administrator, phpMyadmin and others MySQL front ends and MySQL GUI tools.

What Is The Difference Between Char And Varchar?

A list of differences between CHAR and VARCHAR:

CHAR and VARCHAR types are different in storage and retrieval.
CHAR column length is fixed to the length that is declared while creating table. The length value ranges from 1 and 255.
When CHAR values are stored then they are right padded using spaces to specific length. Trailing spaces are removed when CHAR values are retrieved.

What Is The Difference Between Truncate And Delete In Mysql?


The DELETE command is used to delete data from a table. It only deletes the rows of data from the table while, truncate is very dangerous command and should be used carefully because it deletes every row permanently from a table.

How Many Triggers Are Possible In Mysql?

There are only six Triggers allowed to use in MySQL database.

Before Insert
After Insert
Before Update
After Update
Before Delete
After Delete

What Is Heap Table?

Tables that are present in memory is known as HEAP tables. When you create a heap table in MySQL, you should need to specify the TYPE as HEAP. These tables are commonly known as memory tables. They are used for high speed storage on temporary basis. They do not allow BLOB or TEXT fields.

In Which Language Mysql Is Written?

MySQL is written in C and C++ and its SQL parser is written in yacc.

What Are The Technical Specification Of Mysql?

MySQL has the following technical specifications -

Flexible structure
High performance
Manageable and easy to use
Replication and high availability
Security and storage management

What Is The Difference Between Mysql And Sql?


SQL is known as standard query language. It is used to interact with the database like MySQL. MySQL is a database that stores various types of data and keeps it safe.
A PHP script is required to store and retrieve the values inside the database.

What Is The Difference Between Database And Table?

There is a major difference between a database and a table. The differences are as follows:

Tables are a way to represent the division of data in a database while, database is a collection of tables and data.
Tables are used to group the data in relation with each other and create a dataset. This dataset will be used in the database. The data which are stored in the table in any form is a part of the database, but the reverse is not true.

What Is Blob And Text In Mysql?

BLOB is an acronym stands for binary large object. It is used to hold a variable amount of data.

There are four types of BLOB.

TINYBLOB
BLOB
MEDIUMBLOB
LONGBLOB
The differences among all these are the maximum length of values they can hold. TEXT is case-insensitive BLOB. TEXT values are non-binary strings (character string). They have a character set and values are stored and compared based on the collation of the character set.

There are four types of TEXT.

TINYTEXT
TEXT
MEDIUMTEXT
LONGTEXT.

Subscribe to get more Posts :