Interview Questions

* Set the PHP default timezone :

    date_default_timezone_set("Asia/Kolkata"); 
    echo date('d-m-Y H:i:s'); //Returns IST 

* Default mysql post no, host and protocol :   

          mysql --port = 3306 --host=127.0.0.1  
          mysql --port = 3306 --protocol=TCP 

* Index in Sql :

   Indexes allow the database application to find data fast; 
   without reading the whole table.

Indexes

An index can be created in a table to find data more quickly and efficiently.

The users cannot see the indexes, they are just used to speed up searches/queries.

Note: Updating a table with indexes takes more time than updating a table without

(because the indexes also need an update). So you should only create indexes on columns (and tables)

that will be frequently searched against.

SQL CREATE INDEX Syntax

Creates an index on a table. Duplicate values are allowed:

CREATE INDEX index_name
ON table_name (column_name)

 

* Virtual Hosting :

   Ex :1 Virtual hosting is a method for hosting multiple domain names 
       (with separate handling of each name) on a single server (or pool of servers).
       This allows one server to share its resources, such as memory and processor cycles, 
       without requiring all services provided to use the same host name.

   Ex : 2 The term Virtual Host refers to the practice of running more than one web site 
          (such as company1.example.com and company2.example.com) on a single machine. 
          Virtual hosts can be "IP-based", meaning that you have a different IP address 
          for every web site, or "name-based", meaning that you have multiple names running 
          on each IP address. The fact that they are running on the same physical server is 
          not apparent to the end user.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s