Home Tutorial Php Sql MySQL Area

 
 

MySQL Area
Posted on: December 9, 2010 at 12:00 AM
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

 

Related Tags for MySQL Area:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.