Home Tutorial Php Sql MySQL Area

 
 

Share on Google+Share on Google+
MySQL Area
Posted on: December 9, 2010 at 12:00 AM
Advertisement
This example illustrates how to find the area of rectangle in MySQL.

MySQL Area 

This example illustrates how to find the area of rectangle in MySQL.

In this example we create a procedure to find the area of rectangle. In the query below we declare two integer type variable w and h with default value 5 and 4 respectively. By calling the procedure we can run the procedure which execute result.

 

Query

 

DELIMITER $$
CREATE PROCEDURE area1()
	BEGIN
	declare w INT DEFAULT 5;
	declare h INT DEFAULT 4;	 
	select @w * @h;	
	END$$
DELIMITER ;
call area1();

 

Output

 

@w * @h
-------
     20

 

Advertisement

Related Tags for MySQL Area:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 9, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com