## Floyd's triangle in PL/SQL

Updated on 01-Feb-2022 10:59:10
PL/SQL is a combination of SQL along with the procedural features of programming languagesFLOYD’s triangle − it is a triangle formed by natural numbers. It is the triangle formed by filling numbers in rows starting from 1 at the top-left corner. It is a right-angled triangle i.e. the count of numbers in each row is the same as the row number.In this problem, we are given a natural number N. Our task is to create Floyd’s triangle in PL/SQL.Let’s take an example to understand the problemInput: 16 Output: 1 2 3 4 5 6 7 8 9 10 11 12 ... Read More

## Finding sum of first n natural numbers in PL/SQL

Updated on 01-Feb-2022 10:26:35
In this problem, we are given a number N. Our task is to finding sum of first n natural numbers in PL/SQL.PL/SQL is a combination of SQL along with the procedural features of programming languages.PL/SQL has the following features −PL/SQL is tightly integrated with SQL.It offers extensive error checking.It offers numerous data types.It offers a variety of programming structures.It supports structured programming through functions and procedures.It supports object-oriented programming.It supports the development of web applications and server pages.PL/SQL has the following advantages −SQL is the standard database language and PL/SQL is strongly integrated with SQL. PL/SQL supports both static and ... Read More

## Find the area and perimeter of right triangle in PL/SQL

Updated on 27-Jan-2022 08:57:10
In this problem, we are given three values: base, height and hypotenuse of a right triangle. Our task is to find the area and perimeter of the right triangle in PL/SQL.PL/SQL is a combination of SQL along with the procedural features of programming languagesLet's take an example to understand the problem, Input : height = 4, base = 3, hypotenuse = 5 Output : area = 6, perimeter = 12Explanation −1 + 22 + 333 + 4444 = 4800 Solution ApproachA simple approach to solve the problem is using the formula for the area and perimeter of the triangle.Area = ... Read More

## What is PL/SQL?

Updated on 03-Jul-2021 09:14:22
It is a procedural extension language (PL) for the structured query language (SQL) and the Oracle relational database. It provides a built-in, interpreted and OS independent programming environment.Apart from Oracle it also available Times Ten in-memory database and IBM DB2.The Syntax of PL/SQL is based on ADA and Pascal programming languages. PL/SQL is tightly integrated with SQL.PL/SQL offers the following −Extensive error checking.Numerous data types.Variety of programming structures.PL/SQL supports the following −Structured programming through functions.Procedures and object-oriented programming.Development of web applications and server pages.PL/SQL block structureIt defines the type of block (procedure, function, anonymous) and the way it is called, it declares ... Read More

## Sum of the first and last digit of a number in PL/SQL

Updated on 06-Aug-2020 08:15:02
In this problem, we are given a number n. Our task is to create a program to find the sum of the first and last digit of a number in PL/SQL.First, let’s brush-up about PL/SQL, PL/SQL is a combination of SQL along with the procedural features of programming languages.Let’s take an example to understand the problem, Input − n = 31415Output − 8Explanation − first digit = 3 , last digit = 5. Sum = 8To, solve this problem, we will extract the first and last digit to number n. And the print their sum.The first and last digits are ... Read More

## Count no. of characters and words in a string in PL/SQL

Updated on 15-May-2020 10:21:54
We are given a string of any length and the task is to calculate the count of characters and words in a string using PL/SQL.PL/SQL is a combination of SQL along with the procedural features of programming languages.It was developed by Oracle Corporation in the early 90's to enhance the capabilities of SQL. PL/SQL is one of three key programming languages embedded in the Oracle Database, along with SQL itself and Java.In PL/SQL block, we have DECLARE block which is used to declare the variables used in programming and we have BEGIN block where we write the logic for the ... Read More

## Convert distance from km to meters and centimeters in PL/SQL

Updated on 15-May-2020 08:27:43
The task is to convert the distance from kilometers to meters and centimeters in PL/SQL.PL/SQL is the extension of SQL which combines the Data manipulation of SQL with the working of procedural language.According to the problem we should have distance in kilometers whose value we have to convert in meters and centimeters.As per the conversion rule −1km = 1000 meters1km = 100000 centimetersAccording to this conversion rule we want the distance to be converted by a logic in PL/SQL.ExampleInput: kilometer = 10 Output: meter = 10000    Centimeter = 1000000 Input: kilometer = 9 Output: meter = 9000    Centimeter ... Read More

## Database Wars: MSSQL Server, Oracle PL/SQL and MySQL

Updated on 16-Jan-2020 07:56:19
With so many databases in the market, the mind wars have begun and it is the right time to understand the difference and importance of top 3 relational databases in the market – Microsoft SQL Server, Oracle PL/SQL, and MySQL. The relational database management systems have currently become the backbone of the industry and with so many options available, it is difficult to figure out which one to choose.The relational database management systems was introduced in 1980’s. This article is focussing on exploring the history and features of three popular RDBMS in the industry: Microsoft SQL Server, Oracle, and MySQL. ... Read More

## Difference between SQL and PL/SQL

Updated on 27-Nov-2019 07:32:03
SQL, Structural Query Language is a standard database language which is used create, maintain and retrieve the relational database whereas PL/SQL, Procedural Language extension to SQL, it extends SQL and provide it procedural capabilities.Following are the important differences between SQL and PL/SQL.Sr. No.KeySQLPL/SQL1DefinitionSQL, is Structural Query Language for database.PL/SQL is a programming language using SQL for a database.2VariablesSQL has no variables.PL/SQL has variables, data types etc.3Control StructuresSQL has no FOR loop, if control and similar structures.PL/SQL has FOR loop, while loop, if controls and other similar structures.4OperationsSQL can execute a single operation at a time.PL/SQL can perform multiple operation at ... Read More

## Check if a number is Palindrome in PL/SQLs

Updated on 27-Sep-2019 10:42:03
In this section we will see how to check whether a number is Palindrome or not using the PL/SQL. In PL/SQL code, some group of commands are arranged within a block of related declaration of statements.A number is palindrome if the number, and the reverse of that number are same. Suppose a number 12321, this is palindrome, but 12345 is not a palindrome.ExampleDECLARE    n number;    m number;    temp number:=0;    rem number; BEGIN    n :=12321;    m :=n;    while n>0    loop       rem := mod(n, 10);       temp := (temp*10)+rem; ... Read More