• LOGIN
  • No products in the cart.

PHP MySQL Interview Questions and Answers

What is MySQL?

MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle)

What are the technical features of MySQL?

MySQL database software is a client or server system which includes

Multithreaded SQL server supporting various client programs and libraries

Different backend

Wide range of application programming interfaces and

Administrative tools.

Why MySQL is used?

MySQL database server is reliable, fast and very easy to use.  This software can be downloaded as freeware and can be downloaded from the internet.

PHP MySQL Training

What are Heap tables?

HEAP tables are present in memory and they are used for high speed storage on temporary

basis.

  • BLOB or TEXT fields are not allowed
  • Only comparison operators can be used =, <,>, = >,=<
  • AUTO_INCREMENT is not supported by HEAP tables
  • Indexes should be NOT NULL

 What is the default port for MySQL Server?

The default port for MySQL server is 3306.

MySQL.svg

What are the advantages of MySQL when compared with Oracle?

MySQL is open source software which is available at any time and has no cost involved.

MySQL is portable

GUI with command prompt.

Administration is supported using MySQL Query Browser

Differentiate between FLOAT and DOUBLE?

Following are differences for FLOAT and DOUBLE:

  • Floating point numbers are stored in FLOAT with eight place accuracy and it has four bytes.
  • Floating point numbers are stored in DOUBLE with accuracy of 18 places and it has eight bytes.

Differentiate CHAR_LENGTH and LENGTH?

CHAR_LENGTH  is character count whereas the LENGTH is byte count. The numbers are same for Latin characters but they are different for Unicode and other encodings.

How to represent ENUMs and SETs internally?

ENUMs and SETs are used to represent powers of two because of storage optimizations.

What is the usage of ENUMs in MySQL?

ENUM is a string object used to specify set of predefined values and that can be used during table creation.

MySQL

Create table size(name ENUM(‘Small’, ‘Medium’,’Large’);

Who is the father of PHP and explain the changes in PHP versions?

Rasmus Lerdorf is known as the father of PHP.PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3

is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current

generation of PHP, which uses the

Zend engine

under the

hood. PHP 5 uses

Zend engine 2 which,

among other things, offers many additionalOOP features

How can we submit a form without a submit button?

The main idea behind this is to use Java script submit() function in

order to submit the form without explicitly clicking any submit button.

You can attach the document.formname.submit() method to onclick,

onchange events of different inputs and perform the form submission. you

can even built a timer function where you can automatically submit the

form after xx seconds once the loading is done (can be seen in online

test sites).

In how many ways we can retrieve the data in the result set of

MySQL using PHP?

You can do it by 4 Ways1. mysql_fetch_row.

  1. mysql_fetch_array
  2. mysql_fetch_object
  3. mysql_fetch_assoc

How can we create a database using PHP and MySQL?

We can create MySQL database with the use of

mysql_create_db(“Database Name”)

Can we use include (”abc.PHP”) two times in a PHP page “makeit.PHP”?

Yes we can use include() more than one time in any page though it is

not a very good practice.

What storage engines are used in MySQL?

Storage engines are called table types and data is stored in files using various techniques.

Technique involves:

Storage mechanism

Locking levels

Indexing

Capabilities and functions.

What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?

TIMESTAMP column is updated with Zero when the table is created.  UPDATE CURRENT_TIMESTAMP modifier updates the timestamp field to  current time whenever there is a change in other fields of the table.

PHP MySQL Online Training

What is the difference between primary key and candidate key?

Every row of a table is identified uniquely by primary key. There is only one primary key for a table.

Primary Key is also a candidate key. By common convention, candidate key can be designated as primary and which can be used for any foreign key references.

How do you login to MySql using Unix shell?

We can login through this command:

# [mysqldir]/bin/mysql -h hostname -u <UserName> -p <password>

How do you control the max size of a HEAP table?

Maximum size of Heal table can be controlled by MySQL config variable called max_heap_table_size.

November 27, 2019
GoLogica Technologies Private Limited  © 2019. All rights reserved.