Area and Perimeter of Rectangle in PL/SQL Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Prerequisite - PL/SQL introduction In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare variables and between begin and end part, we perform the operations. Given the value of the length, breadth, and the task is to calculate the area and perimeter of the Rectangle. Examples: Input: l = 2, b = 2 Output: Area = 4, Perimeter = 8 Input: l = 4, b = 8 Output: Area = 32, Perimeter=24 Mathematical Formula: Area of rectangle: Length * Breadth Perimeter of rectangle: 2 * ( Length + Breadth) Below is the required implementation: SQL -- Declaration statement DECLARE -- Declaration of length and assigning values l NUMBER(4, 2) := 3; --Declaration of breadth and assigning values b NUMBER(4, 2) := 7; --Declaration of a variable for Area of rectangle a NUMBER(4, 2); --Declaration of a variable for perimeter p NUMBER(4, 2); BEGIN -- calculate area and perimeter a := l * b; p := 2 * (l + b); --Display result dbms_output.Put_line('Area of the rectangle is ' || a); dbms_output.Put_line('Perimeter of the rectangle is ' || p); END; --ENd program Output: Area of the rectangle is 21 Perimeter of the rectangle is 20 Comment More infoAdvertise with us Next Article Area and Perimeter of a circle in PL/SQL J jit_t Follow Improve Article Tags : PL/SQL SQL-PL/SQL square-rectangle Similar Reads Area and Perimeter of a circle in PL/SQL Prerequisite - PL/SQL introduction In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare variables and between begin and end part, we perform the operations. Given the radius of a circle and the task is to find th 1 min read Find the area and perimeter of right triangle in PL/SQL Prerequisite - PL/SQL introduction In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare variables and between begin and end part, we perform the operations. Given the lengths of hypotenuse, base, and height of a 2 min read Program to find Perimeter / Circumference of Square and Rectangle The circumference of a figure is the sum of all the side lengths. To calculate the circumference of square, length of one of the side is required as all sides are equal. To calculate the circumference of rectangle, length and breadth of rectangle is required. Circumference of a Square:  The circumf 5 min read Area of a Square | Using Side, Diagonal and Perimeter Given one of the Sides S, Diagonal D, or Perimeter P of the square, the task is to find the area of the square with the given value. Examples: Input: S = 5 Output: Area of the square using side = 25 Input: D = 4 Output: Area of the square using diagonal = 8 Input: P = 32 Output: Area of the square u 7 min read Perimeter of the Union of Two Rectangles Given two arrays X[] and Y[], each of length 4, where (X[0], Y[0]) and (X[1], Y[1]) represents the bottom left and top right corners of one rectangle and (X[2], Y[2]) and (X[3], Y[3]) represents the bottom left and top right corners of the other rectangle, the task is to find the perimeter of the ou 7 min read Check whether a given point lies inside a rectangle or not Given four points of a rectangle, and one more point P. Write a function to check whether P lies within the given rectangle or not.Examples:  Input : R = [(10, 10), (10, -10), (-10, -10), (-10, 10)] P = (0, 0)Output : yesIllustration :Input : R = [(10, 10), (10, -10), (-10, -10), (-10, 10)], P = (20 14 min read Like