Samsung SDS Most Frequently Asked Latest MySQL Interview Questions Answers
What is the different between NOW() and CURRENT_DATE()?
NOW () command is used to show current year,month,date with hours,minutes and seconds.
CURRENT_DATE() shows current year,month and date only.
What are the objects can be created using CREATE statement?
Following objects are created using CREATE statement:
DATABASE
EVENT
FUNCTION
INDEX
PROCEDURE
TABLE
TRIGGER
USER
VIEW
How many TRIGGERS are allowed in MySql table?
SIX triggers are allowed in MySql table. They are as follows:
BEFORE INSERT
AFTER INSERT
BEFORE UPDATE
AFTER UPDATE
BEFORE DELETE and
AFTER DELETE
What is the difference between mysql_fetch_array and mysql_fetch_object?
Following are the differences between mysql_fetch_array and mysql_fetch_object:
mysql_fetch_array() -Returns a result row as an associated array or a regular array from database.
mysql_fetch_object – Returns a result row as object from database.
How can we run batch mode in mysql?
Following commands are used to run in batch mode:
mysql ;
mysql mysql.out
1
2
mysql ;
mysql mysql.out
Where MyISAM table will be stored and also give their formats of storage?
Each MyISAM table is stored on disk in three formats:
The ‘.frm’ file stores the table definition
The data file has a ‘.MYD’ (MYData) extension
The index file has a ‘.MYI’ (MYIndex) extension
What are the different tables present in MySQL?
Total 5 types of tables are present:
MyISAM
Heap
Merge
INNO DB
ISAM
MyISAM is the default storage engine as of MySQL .
What is ISAM?
ISAM is abbreviated as Indexed Sequential Access Method.It was developed by IBM to store and retrieve data on secondary storage systems like tapes.
What is InnoDB?
lnnoDB is a transaction safe storage engine developed by Innobase Oy which is a Oracle Corporation now.
What are the nonstandard string types?
Following are Non-Standard string types:
TINYTEXT
TEXT
MEDIUMTEXT
LONGTEXT
Tell us something about Heap tables.
- HEAP tables are found in memory.
- They are used for high speed storage on temporary basis.
Some of their characteristics are:
- They do not allow BLOB or TEXT fields.
- Only comparison operators like =, <, >, = >, =< can be used with them.
- AUTO_INCREMENT is not supported by HEAP tables
- Indexes should be NOT NULL
How do you control the max size of a HEAP table?
- Maximum size of Heap table can be controlled using MySQL config variable called max_heap_table_size.
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
What Does " I_am_a_dummy Flag" Do In Mysql?
The " i_am_a_dummy flag" enables MySQL engine to refuse any UPDATE or DELETE statement to execute if the WHERE clause is not present.
How To Get The Current Date In Mysql?
To get current date, use the following syntax:
SELECT CURRENT_DATE();
What Are The Security Alerts While Using Mysql?
Install antivirus and configure the operating system's firewall.
Never use the MySQL Server as the UNIX root user.
Change root username and password
Restrict or disable remote access.
How To Change A Password For An Existing User Via Mysqladmin?
Mysqladmin -u root -p password "newpassword".
What Is The Difference Between Unix Timestamps And Mysql Timestamps?
Actually both Unix timestamp and MySQL timestamp are stored as 32-bit integers but MySQL timestamp is represented in readable format of YYYY-MM-DD HH:MM:SS format.
How To Display Nth Highest Salary From A Table In A Mysql Query?
Let us take a table named employee.
To find Nth highest salary is:
1. select distinct(salary) from employee order by salary desc limit n-1,1
if you want to find 3rd largest salary:
1. select distinct(salary) from employee order by salary desc limit 2,1.
What is the different between NOW() and CURRENT_DATE()?
NOW () command is used to show current year,month,date with hours,minutes and seconds.
CURRENT_DATE() shows current year,month and date only.
What are the objects can be created using CREATE statement?
Following objects are created using CREATE statement:
DATABASE
EVENT
FUNCTION
INDEX
PROCEDURE
TABLE
TRIGGER
USER
VIEW
Samsung SDS Most Frequently Asked Latest MySQL Interview Questions Answers |
How many TRIGGERS are allowed in MySql table?
SIX triggers are allowed in MySql table. They are as follows:
BEFORE INSERT
AFTER INSERT
BEFORE UPDATE
AFTER UPDATE
BEFORE DELETE and
AFTER DELETE
What is the difference between mysql_fetch_array and mysql_fetch_object?
Following are the differences between mysql_fetch_array and mysql_fetch_object:
mysql_fetch_array() -Returns a result row as an associated array or a regular array from database.
mysql_fetch_object – Returns a result row as object from database.
How can we run batch mode in mysql?
Following commands are used to run in batch mode:
mysql ;
mysql mysql.out
1
2
mysql ;
mysql mysql.out
Where MyISAM table will be stored and also give their formats of storage?
Each MyISAM table is stored on disk in three formats:
The ‘.frm’ file stores the table definition
The data file has a ‘.MYD’ (MYData) extension
The index file has a ‘.MYI’ (MYIndex) extension
What are the different tables present in MySQL?
Total 5 types of tables are present:
MyISAM
Heap
Merge
INNO DB
ISAM
MyISAM is the default storage engine as of MySQL .
What is ISAM?
ISAM is abbreviated as Indexed Sequential Access Method.It was developed by IBM to store and retrieve data on secondary storage systems like tapes.
What is InnoDB?
lnnoDB is a transaction safe storage engine developed by Innobase Oy which is a Oracle Corporation now.
What are the nonstandard string types?
Following are Non-Standard string types:
TINYTEXT
TEXT
MEDIUMTEXT
LONGTEXT
How many TRIGGERS are allowed in MySql table?
MySql table allows following 6 triggers:
- BEFORE INSERT
- AFTER INSERT
- BEFORE UPDATE
- AFTER UPDATE
- BEFORE DELETE and
- AFTER DELETE
MySql table allows following 6 triggers:
- BEFORE INSERT
- AFTER INSERT
- BEFORE UPDATE
- AFTER UPDATE
- BEFORE DELETE and
- AFTER DELETE
Differentiate between FLOAT and DOUBLE.
FLOAT stores floating point numbers with accuracy up to eight places and has four bytes while DOUBLE stores floating point numbers with accuracy upto 18 places and has eight bytes.
FLOAT stores floating point numbers with accuracy up to eight places and has four bytes while DOUBLE stores floating point numbers with accuracy upto 18 places and has eight bytes.
Tell us something about Heap tables.
- HEAP tables are found in memory.
- They are used for high speed storage on temporary basis.
Some of their characteristics are:
- They do not allow BLOB or TEXT fields.
- Only comparison operators like =, <, >, = >, =< can be used with them.
- AUTO_INCREMENT is not supported by HEAP tables
- Indexes should be NOT NULL
How do you control the max size of a HEAP table?
- Maximum size of Heap table can be controlled using MySQL config variable called max_heap_table_size.
What are the advantages of MySQL in comparison to Oracle?
- MySQL is open source software available at zero cost.
- It is portable.
- GUI with command prompt.
- Administration is supported by MySQL Query Browser.
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.
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
What Does " I_am_a_dummy Flag" Do In Mysql?
The " i_am_a_dummy flag" enables MySQL engine to refuse any UPDATE or DELETE statement to execute if the WHERE clause is not present.
How To Get The Current Date In Mysql?
To get current date, use the following syntax:
SELECT CURRENT_DATE();
What Are The Security Alerts While Using Mysql?
Install antivirus and configure the operating system's firewall.
Never use the MySQL Server as the UNIX root user.
Change root username and password
Restrict or disable remote access.
How To Change A Password For An Existing User Via Mysqladmin?
Mysqladmin -u root -p password "newpassword".
What Is The Difference Between Unix Timestamps And Mysql Timestamps?
Actually both Unix timestamp and MySQL timestamp are stored as 32-bit integers but MySQL timestamp is represented in readable format of YYYY-MM-DD HH:MM:SS format.
How To Display Nth Highest Salary From A Table In A Mysql Query?
Let us take a table named employee.
To find Nth highest salary is:
1. select distinct(salary) from employee order by salary desc limit n-1,1
if you want to find 3rd largest salary:
1. select distinct(salary) from employee order by salary desc limit 2,1.
Post a Comment