Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:

  • CREATE – to create objects in the database
  • ALTER – alters the structure of the database
  • DROP – delete objects from the database
  • TRUNCATE – remove all records from a table, including all spaces allocated for the records are removed
  • COMMENT – add comments to the data dictionary
  • RENAME – rename an object


Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:

  • SELECT – retrieve data from the a database
  • INSERT – insert data into a table
  • UPDATE – updates existing data within a table
  • DELETE – deletes all records from a table, the space for the records remain
  • MERGE – UPSERT operation (insert or update)
  • CALL – call a PL/SQL or Java subprogram
  • EXPLAIN PLAN – explain access path to data
  • LOCK TABLE – control concurrency


Data Control Language (DCL) statements. Some examples:

  • GRANT – gives user’s access privileges to database
  • REVOKE – withdraw access privileges given with the GRANT command


Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.

  • COMMIT – save work done
  • SAVEPOINT – identify a point in a transaction to which you can later roll back
  • ROLLBACK – restore database to original since the last COMMIT
  • SET TRANSACTION – Change transaction options like isolation level and what rollback segment to use



1. Short for Internet Protocol address, an IP address is an address of a computer or other network device on a network using TCP/IP. For example, the number “” is an example of such an address. These addresses are similar to an addresses used on a house and is what allows data to reach the appropriate destination on a network and the Internet.

There are five classes of available IP ranges: Class A, Class B, Class C, Class D and Class E, while only A, B, and C are commonly used. Each class allows for a range of valid IP addresses. Below is a listing of these addresses.

Class Address Range Supports
Class A to Supports 16 million hosts on each of 127 networks.
Class B to Supports 65,000 hosts on each of 16,000 networks.
Class C to Supports 254 hosts on each of 2 million networks.
Class D to Reserved for multicast groups.
Class E to Reserved for future use, or Research and Development Purposes.

Ranges 127.x.x.x are reserved for the loopback or localhost, for example, is the common loopback address. Range broadcasts to all hosts on the local network.

IP address breakdown

Every IP address is broke down into four sets of octets that break down into binary to represent the actual IP address. The below table is an example of the IP If you are new to binary, we highly recommend reading our binary and hexadecimal conversions section to get a better understanding of what we’re doing in the below charts.

IP: 255 255 255 255
Binary value: 11111111 11111111 11111111 11111111
Octet value: 8 8 8 8

If we were to break down the IP “”, you would get the below value. In the below table, the first row is the IP address, the second row is the binary values, and the third row shows how the binary value equals the section of the IP address.

166 70 10 23
10100110 01000110 00001010 00010111
128+32+4+2=166 64+4+2=70 8+2=10 16+4+2+1=23

Automatically assigned addresses

There are several IP addresses that are automatically assigned when you setup a home network. These default addresses are what allow your computer and other network devices to communicate and broadcast information over your network. Below is the most commonly assigned network addresses in a home network. 0 is the automatically assigned network address. 1 is the commonly used address used as the gateway. 2 is also a commonly used address used for a gateway. – 254 Addresses beyond 3 are assigned to computers and devices on the network. 255 is automatically assigned on most networks as the broadcast address.

If you have ever connected to your home network, you should be familiar with the gateway address or, which is the address you use to connect to your home network router and change its settings.

Getting an IP address

By default the router you use will assign each of your computers their own IP address, often using NAT to forward the data coming from those computers to outside networks such as the Internet. If you need to register an IP address that can be seen on the Internet, you must register through InterNIC or use a web host that can assign you addresses.

Anyone who connects to the Internet is assigned an IP address by their Internet Service Provider (ISP) who has registered a range of IP addresses. For example, lets assume your ISP is given 100 addresses, This means the ISP owns addresses to and is able to assign any address in that range to its customers. So, all these addresses belong to your ISP address until they are assigned to a customers computer. In the case of a dial-up connection, you are given a new IP address each time you dial into your ISP. With most broadband Internet service providers because you are always connected to the Internet your address rarely changes and will remain the same until the service provider requires it to be changed.

Connecting to the Internet

The above picture is taken from our “How do computers connect to each other over the Internet?” document and gives a good overview of how a computer can talk to another computer over the Internet using an IP address.

Courtesy :- http://www.computerhope.com/jargon/i/ip.htm

MySQL and SQL Server are the two leading databases that support front end applications related to various domains. The differences between MySQL and SQL Server are listed below:

MySQL SQL Server
MySQL is available for free since MySQL is an open source. SQL Server is not an open source and payment has to be made to use SQL Server.
MySQL offers only updateable views. SQL Server offers indexed views which are much more powerful, performance wise.
MySQL does not support XML. SQL Server supports XML.
MySQL provides only table level security. SQL Server provides column level security.
MySQL does not offer any certification for security. SQL Server has C2 compliant certification. Database security is verified by third party.
Earlier versionsof MySQL does not support triggers. Only MySQL 5.0 supports triggers. SQL Server provides triggers.
User defined functions are not supported in MySQL. User defined functions are supported in SQL Server.
Cursor feature is not available in MySQL. Cursor feature is available in SQL Server.
Stored procedures and full join facility is not offered in MySQL. Stored procedures and full join facility are offered in SQL Server.
Import and Export functions have very limited support in MySQL. Import and export are extensively supported in MySQL.
Transaction support is very much limited in MySQL. Transaction support is extensively and fully offered in SQL Server.
Replication support is very much limited in MySQL. Replication support is extensively and fully offered in SQL Server.
Auto tuning is not supported in MySQL. Auto tuning is supported in SQL Server.
Job scheduling and profiling are not available in MySQL. Job scheduling and profiling are available in MySQL.
Online backup support and clustering support is limited in MySQL. Online backup support and clustering support is extensive and complete in SQL Server.
Log Shipping and Storage Area Network support is not available in MySQL. Log Shipping and Storage Area Network support is available in SQL Server.
OLAP Services, Data Reporting and Data Mining are not supported in MySQL. OLAP Services, Data Reporting and Data Mining are supported in SQL Server.

Common Ports

Posted: April 21, 2014 in Database

Common Ports

20 FTP data (File Transfer Protocol)
21 FTP (File Transfer Protocol)
22 SSH (Secure Shell)
23 Telnet
25 SMTP (Send Mail Transfer Protocol)
43 whois
53 DNS (Domain Name Service)
68 DHCP (Dynamic Host Control Protocol)
79 Finger
80 HTTP (HyperText Transfer Protocol)
110 POP3 (Post Office Protocol, version 3)
115 SFTP (Secure File Transfer Protocol)
119 NNTP (Network New Transfer Protocol)
123 NTP (Network Time Protocol)
137 NetBIOS-ns
138 NetBIOS-dgm
139 NetBIOS
143 IMAP (Internet Message Access Protocol)
161 SNMP (Simple Network Management Protocol)
194 IRC (Internet Relay Chat)
220 IMAP3 (Internet Message Access Protocol 3)
389 LDAP (Lightweight Directory Access Protocol)
443 SSL (Secure Socket Layer)
445 SMB (NetBIOS over TCP)
666 Doom
993 SIMAP (Secure Internet Message Access Protocol)
995 SPOP (Secure Post Office Protocol)

Ports between 1024 and 29151 are known as the Registered Ports. Basically, programs are supposed to register their use of these ports and thereby try to be careful and avoid stomping on each other. Here are some common ports and their programs.

1243 SubSeven (Trojan – security risk!)
1352 Lotus Notes
1433 Microsoft SQL Server
1494 Citrix ICA Protocol
1521 Oracle SQL
1604 Citrix ICA / Microsoft Terminal Server
2049 NFS (Network File System)
3306 mySQL
4000 ICQ
5010 Yahoo! Messenger
5190 AOL Instant Messenger
5632 PCAnywhere
5800 VNC
5900 VNC
6000 X Windowing System
6699 Napster
6776 SubSeven (Trojan – security risk!)
7070 RealServer / QuickTime
7778 Unreal
8080 HTTP
26000 Quake
27010 Half-Life
27960 Quake III
31337 BackOrifice (Trojan – security risk!)


WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time.Now Most of users are started development on WordPress The main reason for its popularity is its admin very easy to use and manage.Its will work on apr. 60 million websites world wide.

So now all IT firm started hiring developer for WordPress but main thing what exact qualification we needed and exactly what knowledge we are looking for.So here is the some basic & Technical question answer that at-least developers knows.

In this blog find some technical Question & Answer of WordPress.

Que 1 How we will pass a variable by value in WordPress.
Ans. Its same like we will work in c,c++
$p = &$s

Que 2 Basic functions then we generally used in WordPress? Why?
Ans: If developer have good knowledge then he/she must know this function name at-least 3-5

1. is_page() :- Condition for check if page is displayed. Its return true or false.
2. wp_nav_menu() :- Enabling WordPress 3.0′s Navigation Menu Feature
3. wp_list_pages() :- Listing All Pages
4. get_excerpt() :- Displays the excerpt of the current post with read more link for display full post.
5. is_category() :- Condition for check if category is displayed. Its return true or false.
6. the_title():- Displays the title of the current post
7. the_content():- Displays the contents of the current post.
8. bloginfo(‘url’) :- Getting the Site’s URL
9. bloginfo(‘template_url’) :- Getting the URL to the Current Theme
10.the_time():- Display the time the post was published (uses PHP date formatting as a parameter):

Que 3 How many tables a default WordPress will have?
Ans If developer work with database then he/she must know how many table install with default wordpress.
A default wordpress will have 11 tables. They are-
1. wp_commentmeta
2. wp_comments
3. wp_links
4. wp_options
5. wp_postmeta
6. wp_posts
7. wp_terms
8. wp_term_relationships
9. wp_term_taxonomy

Que 4 Is WordPress good for Google ranking and SEO?
Ans Yes, That is one of the major selling points of using WordPress is that it includes excellent built in search engine optimization (SEO).In Other CMS you have to install SEO extention they either free or Commercial.In WordPress you can also extend SEO feature by using some Nice FREE SEO plugins likes All in one SEO,Yoast These are popular plugins that are known to help your rank on search engines such as Google and Bing.

Que 5 How to hide the top admin bar at the frontend in WordPress.
Ans. Most of developer have no idea about this.
Add the below mentioned code in the theme(active) function.php

Add the below code in the active theme style.css stylesheet
#wpadminbar {
display: none; visibility: hidden;

Que 6 How to hide Directory Browsing in WordPress from server using .htaccess file?

By default when your web server does not find an index file (i.e. a file like index.php or index.html), it automatically displays an index page showing the contents of the directory.SO now if you want to hide this add below code in .htaccess file.

Que 7 What are the custom fields in wordpress? How to display it?
Ans We will add extra information to our post by using custom fields.Custom Fields are a form of meta-data that allows us to store arbitrary information with each WordPress post.
To display the Custom Fields for each post, use the the_meta() template tag.
To fetch meta values use the get_post_meta() function.
For example we use custom fields:-

Que 8 What is the use of loop in Worpdress Where we used it?
Ans. The Loop are php code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page.check below sample code.

Que 9 How to run database Query in WordPress?
Ans. The $wpdb->query function allows you to execute any SQL query on the WordPress database. It is best to use a more specific function. Check sample code below for SELECT query.

Que 10 How to Change Your Default WordPress Post Category & Post Type?
Ans. Most common issue and most of developer not know this and find hacking(custom coding solution).But it more easy then that.simply navigate to Settings > Writing > and then look for the pull down menu beside “Default Post Categoy.” for change default category selection.

Writing Setting
Below that you can find Default post format for changes post type from standard to image post type or a video post type,chat gallery,link and many more.

Que 11 How to Change the Length of the Default WordPress Excerpt.
Ans The default WordPress excerpt is 55 words long. By modified bit to your functions.php file you can change the length to as you required.Below is the code if we need 60 length.

Que 12 How to add option for open menu item in new tab?
Ans. This is very basic feature but sometime developer never use this so they have no idea and goto code and add manually that links.For add option in menu item for open link in new tab just navigate to “Screen Option” at top right corner in menu select check “link target”. See below screenshot.


Que 13 What is hooks and types of hooks in wordpress?Where it used?
Ans. Hooks are provided by WordPress to allow your plugin to ‘hook into’ WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion. There are two types of hooks used in WordPress are Actions and Filters.

1)Actions Run During a Typical Request.for example A developer may want to add code to the footer of a Theme. This could be accomplished by writing new function, then Hooking it to the wp_footer Action.
2)Filters are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen.
Que 14 What is child theme? Why we used it?
Ans A WordPress child theme is a WordPress theme that inherits its functionality from its parent WordPress theme.Child themes are often used when you want to customize or tweak an existing WordPress theme without losing the ability to upgrade that theme.
Advantage is child theme is Safe Updates,Easy to Extend,Fallback Safe

Que 15 What is the Basic Difference Between Posts vs. Pages.
Ans. Posts are timely vs. Pages are timeless.
Posts are social vs. Pages are NOT.
Posts can be categorized vs. Pages are hierarchical.
Posts are included in RSS feed vs. Pages are not.
Pages have custom template feature vs. Posts do not.


In PHP Random Number Generator, I have explained how to Generate a random number with in a range / Generate a random string with given length.In PHP,  we can use rand() function to generate random number. using this function we can make random string also.

PHP rand() Syntax:

//Generates random number
int rand(void);
//Generate random number in range from $min , to $max (inclusive)
int rand($min,$max);

1).PHP Random Number

$rand_value =rand();
echo $rand_value."\n";

2).PHP Random Number in a Range(10..100)

$rand_value = rand(10,100); //generates a number from 10 to 100
echo $rand_value."\n";

3).PHP Generate Random String

function gen_random_string($length=16)
    $chars ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";//length:36
    for($i=0;$i<$length; $i++)
        $final_rand .= $chars[ rand(0,strlen($chars)-1)];
    return $final_rand;
echo gen_random_string()."\n"; //generates a string
echo gen_random_string(8)."\n"; //generates a string with length 8


4).PHP Generate random number with given length

function gen_random($length=32)
    for($i=0;$i< $length;$i++)
        $final_rand .= rand(0,9);
    return $final_rand;
echo gen_random(10)."\n";//random number with length 10
echo gen_random()."\n";//random number with length 32